Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/17/2022 in all areas

  1. Only suggestion is to play with the WinHTTP timeouts controlled by the array $_WD_HTTPTimeOuts
    1 point
  2. Yes, it makes sense to me. This is what's happening -- Chrome shuts down A request is sent to the Chromedriver via __WD_Get Chromedriver attempts to communicate with Chrome (*** delay is occurring here ***) Chromedriver returns an error to __WD_Get stating that Chrome was unreachable
    1 point
  3. Hi again, damn, right now I saw the post of @ahmet who directed already to the solution 👍 . The first example in the help reference to _GDIPlus_GraphicsDrawImage should be exactly what you're looking for. Best regards Sven ________________ Stay innovative!
    1 point
  4. smbape

    add image to image

    Hi @ahmeddzcom Using OpenCV v4 UDF #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include "autoit-opencv-com\udf\opencv_udf_utils.au3" _OpenCV_Open_And_Register("opencv-4.5.5-vc14_vc15\opencv\build\x64\vc15\bin\opencv_world455.dll", "autoit-opencv-com\autoit_opencv_com455.dll") Global $cv = _OpenCV_get() Global $big = $cv.imread("cat.jpg") Global $small = $cv.imread("core.jpg") ; Rect is [x, y, width, height] Global $roi[4] = [($big.width - $small.width) / 2, ($big.height - $small.height) / 2, $small.width, $small.height ] $small.copyTo(ObjCreate("OpenCV.cv.Mat").create($big, $roi)) $cv.imwrite(@ScriptDir & "\pasted2.png", $big) $cv.imshow("copy", $big) $cv.waitKey() $cv.destroyAllWindows() _OpenCV_Unregister_And_Close()
    1 point
  5. Hi @ahmeddzcom, I did a similar thing in the past, but the script just appends several images to a long single image. Maybe I find that code and can adjust this or you will do it on your own. Depends on finding the script 😉 . I'll get back soon. Best regards Sven ________________ Stay innovative!
    1 point
  6. ahmet

    add image to image

    Look for GdiPlusGraphicsDrawImage
    1 point
  7. It is an myth that an obfuscator will protect your code, it only makes it hard to read.
    1 point
  8. ad777

    add image to image

    @ahmeddzcom you can copy image from Paint Window to another Paint Window using Autoit Script: SendKeepActive("1.jpg - Paint") ;Attempts to keep a specified window active during Send(). Send("^a") ;send ctrl + A -> select all Send("^c") ;send ctrl + c -> copy SendKeepActive("2.jpg - Paint") ;Attempts to keep a specified window active during Send(). Send("^v") ;send ctrl + v -> paste ;note title 1: 1.jpg , title 2 2.jpg
    1 point
  9. I UNDERSTAND. Anyway, is there an official obfuscator today? Or is there another alternative to protect code to prevent theft other than an obfuscator? Thank you.
    1 point
  10. yeah it's possible,you can logoff user by [ID] using cmd:logoff ID thx to @Subz for the _Array1Dto2D or you can logoff user by name here is script for it: #RequireAdmin #include <Array.au3> #include <AutoItConstants.au3> _LogoffUser("name");;; name of person you want to log off Func _LogoffUser($user) Global $sOutput FileDelete(".\list.log") Sleep(10) Local $iPID = Run(@ComSpec & " /c " & "query session", "", @SW_HIDE, $STDOUT_CHILD) While 1 $sOutput &= StdoutRead($iPID) If $sOutput <> "" And StringInStr($sOutput, $user) Then FileWriteLine(".\list.log", $sOutput) Local $sFilePath = ".\list.log" Local $sFileData = FileRead($sFilePath) Local $sHeader = FileReadLine($sFilePath, 1) Local $iColumn1 = StringInStr($sHeader, "USERNAME") - 1 Local $iColumn2 = StringInStr($sHeader, "ID") - $iColumn1 - 1 Local $iColumn3 = StringLen($sHeader) - $iColumn1 - $iColumn2 - 1 Local $aFileData1D = StringRegExp($sFileData, "(.{" & $iColumn1 & "})(.{" & $iColumn2 & "})(.{" & $iColumn3 & "})", 3) Local $aFileData2D = _Array1DTo2D($aFileData1D, 3) Local $iSearch = _ArraySearch($aFileData2D, $user, 0, 0, 0, 1, 1, 1) Local $SeasonID = StringReplace($aFileData2D[$iSearch][2], "Disc", "") Run(@ComSpec & " /c " & "logoff " & $SeasonID, "", @SW_HIDE) ExitLoop EndIf WEnd EndFunc ;==>_LogoffUser Func _Array1DTo2D($avArray, $iCols, $iStart = 0, $iEnd = 0, $iFlag = 0) If $iStart = Default Or $iStart < 0 Then $iStart = 0 If $iEnd = Default Then $iEnd = 0 If Not IsArray($avArray) Then Return SetError(1, 0, 0) If UBound($avArray, 0) <> 1 Then Return SetError(3, 0, 0) Local $iUBound = UBound($avArray) - 1 If $iEnd < 1 Then $iEnd = $iUBound If $iEnd > $iUBound Then $iEnd = $iUBound If $iStart > $iEnd Then Return SetError(2, 0, 0) Local $iNbRows = ($iEnd - $iStart + 1) / $iCols If $iFlag And IsFloat($iNbRows) Then Return SetError(2, 0, 0) Local $aRet[Ceiling($iNbRows)][$iCols] Local $iCol = 0, $iRow = 0 For $i = $iStart To $iEnd If $iCol = $iCols Then $iCol = 0 $iRow += 1 EndIf $aRet[$iRow][$iCol] = $avArray[$i] $iCol += 1 Next Return $aRet EndFunc ;==>_Array1DTo2D
    1 point
  11. $_WD_DEBUG is declared as a global variable in wd_core, so no point in declaring it again If you set $_WD_DEBUG = $_WD_DEBUG_Error, then this may help you understand the delay in closing You should be able to reduce the delay by changing the contents of the global array $_WD_HTTPTimeOuts, ie: $_WD_HTTPTimeOuts[1] = 1000 ; Connect timeout is now one second
    1 point
  12. Hi folks, I released Version v2.1.0, see CHANGELOG. @big_daddy I changed to proper escape pattern ✔ I switched to !_ instead of !au3_, because almost all user defined functions starting with a underscore ⚠ Function names are adjusted to starting with capital letter (after the underscore) to fit more common practise ✔ I still try to provide a user friendly way of snippet generation (the snippet management extensions that you mentioned, aren't that good) ⚠ Next release coming soon 😁 . Best regards Sven ________________ Stay innovative!
    1 point
  13. UEZ

    GDI + Zooming?

    This is an old script which I coded a while ago. #include <GUIConstantsEx.au3> #include <Misc.au3> #include <Screencapture.au3> #include <WindowsConstants.au3> Global $sx, $z = 10, $sy, $mc2, $f, $scroll_x, $scroll_y Global Const $gdip_x = 0, $gdip_y = 0, $zmin = 5, $zmax = 15, $bg_c = "404040" Global Const $gdip_w = 800, $gdip_h = 600 Global $bW = $gdip_w, $bH = $gdip_h Global Const $hGUI = GUICreate("GDI+ Test", $gdip_w, $gdip_h) GUISetState() Global Const $dll = DllOpen("user32.dll") _GDIPlus_Startup() Global Const $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) Global Const $hBuffer_Bmp = _GDIPlus_BitmapCreateFromGraphics($gdip_w, $gdip_h, $hGraphic) Global Const $hContext = _GDIPlus_ImageGetGraphicsContext($hBuffer_Bmp) _GDIPlus_GraphicsSetPixelOffsetMode($hContext, 2) ;~ _GDIPlus_GraphicsSetCompositingQuality($hContext, 2) _GDIPlus_GraphicsSetInterpolationMode($hContext, 5) Global $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $gdip_w / 2, $gdip_h / 2) Global Const $hHBitmap = _ScreenCapture_Capture("", 0, 0, $gdip_w, $gdip_h) Global Const $hBmp = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) Draw2Graphic($hBmp) Zoom(2) GUIRegisterMsg($WM_MOUSEWHEEL, "_Mousewheel") Do $mc2 = MouseGetPos() While _IsPressed("01", $dll) $mc3 = MouseGetPos() If $mc2[0] <> $mc3[0] Or $mc2[1] <> $mc3[1] Then $scroll_x = ($sx + ($mc3[0] - $mc2[0]) / ($z ^ 2 / 32)) $scroll_y = ($sy + ($mc3[1] - $mc2[1]) / ($z ^ 2 / 32)) Draw2Graphic($hBmp) Zoom(2) EndIf Sleep(10) WEnd $sx = $scroll_x $sy = $scroll_y Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_MatrixDispose($hMatrix) _WinAPI_DeleteObject($hHBitmap) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_GraphicsDispose($hContext) _GDIPlus_BitmapDispose($hBuffer_Bmp) _GDIPlus_BitmapDispose($hBmp) _GDIPlus_Shutdown() GUIDelete() DllClose($dll) Exit Func Draw2Graphic($hImage) Local $w, $h _GDIPlus_GraphicsClear($hContext, "0xFF" & $bg_c) If $bW <= $gdip_w And $bH <= $gdip_h Then $f = 1 _GDIPlus_GraphicsDrawImageRect($hContext, $hImage, $gdip_w / 2 - $bW / 2 - $scroll_x, $gdip_h / 2 - $bH / 2 - $scroll_y, $bW, $bH) Else If $bW >= $bH Then $f = $bW / $gdip_w Else $f = $bH / $gdip_h EndIf $w = Floor($bW / $f) $h = Floor($bH / $f) If $w > $gdip_w Then $f = $bW / $gdip_w ElseIf $h > $gdip_h Then $f = $bH / $gdip_h EndIf _GDIPlus_GraphicsDrawImageRect($hContext, $hImage, $gdip_w / 2 - $w / 2 - $scroll_x, $gdip_h / 2 - $h / 2 - $scroll_y, $w, $h) EndIf EndFunc ;==>Draw2Graphic Func Zoom($zoom_dir) Switch $zoom_dir Case -1 _GDIPlus_MatrixDispose($hMatrix) $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $gdip_w / 2, $gdip_h / 2) _GDIPlus_MatrixScale($hMatrix, 1 / $f, 1 / $f) $scroll_x = 0 $scroll_y = 0 Case 0 If $z > $zmin Then _GDIPlus_MatrixScale($hMatrix, 0.95, 0.95) $z -= 0.05 EndIf Case 1 If $z <= $zmax Then _GDIPlus_MatrixScale($hMatrix, 1.05, 1.05) $z += 0.05 EndIf Case 2 _GDIPlus_MatrixScale($hMatrix, 1, 1) EndSwitch _GDIPlus_GraphicsSetTransform($hContext, $hMatrix) _GDIPlus_GraphicsClear($hContext, "0xFF" & $bg_c) ;~ _GDIPlus_GraphicsDrawImage($hContext, $hBmp, -$bW / 2 + $scroll_x, -$bH / 2 + $scroll_y) _GDIPlus_GraphicsDrawImageRect($hContext, $hBmp, -$bW / 2 + $scroll_x, -$bH / 2 + $scroll_y, $gdip_w, $gdip_h) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBuffer_Bmp, $gdip_x, $gdip_y, $gdip_w, $gdip_h) EndFunc ;==>Zoom Func _Mousewheel($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 0xFF880000 ;mouse wheel up Zoom(0) Return 0 Case 0x00780000 Zoom(1) Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_Mousewheel Zoom with mouse wheel, move picture around by pressing the lmb and moving mouse.
    1 point
  14. Here it works as designed Be aware that your code returns the row count in line 0 of the array. To drop the row count use: $d = _ArrayUnique($bat, Default, Default, Default, $ARRAYUNIQUE_NOCOUNT)
    1 point
  15. Subz

    Registry search

    Here is a broken down version of the script which will write it file name, you can change the separator at the top of the script if you want to use semi-colon: #include <Array.au3> Local $iCount = 1 ;~ Count number of entries found Local $sSeparator = "," ;~ Change to semi-colon if you wish Local $sFileName = @DesktopDir & "\test.csv" Local $hFileOpen = FileOpen($sFileName, 10) ;~ Gets All 32-Bit Uninstall Keys _RegReadUninstall("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\") ;~ Gets All 64-Bit Uninstall Keys _RegReadUninstall("HKLM64\Software\Microsoft\Windows\CurrentVersion\Uninstall\") FileClose($hFileOpen) ShellExecute($sFileName) ;~ Open the File afterwards Func _RegReadUninstall($_sRegKeyHive = "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\") $_sRegKeyHive = StringRight($_sRegKeyHive, 1) = "\" ? $_sRegKeyHive : $_sRegKeyHive & "\" ;~ Makes sure last entry is backslash Local $a_RegReadUninstall[1][6] = [["Count", "Registry Key", "DisplayName", "UninstallString", "QuietUninstallString", "(Standard"]] Local $i = 1 While 1 $sRegKeyName = RegEnumKey($_sRegKeyHive, $i) If @error then ExitLoop $sRegResults = _ RegRead($_sRegKeyHive & $sRegKeyName,"DisplayName") & "|" & _ RegRead($_sRegKeyHive & $sRegKeyName, "UninstallString") & "|" & _ RegRead($_sRegKeyHive & $sRegKeyName, "QuietUninstallString") & "|" & _ RegRead($_sRegKeyHive & $sRegKeyName, "(Standard)") If StringStripWS(StringReplace($sRegResults, "|", ""), 8) = "" Then $i += 1 ContinueLoop EndIf _ArrayAdd($a_RegReadUninstall, $iCount & "|" & $_sRegKeyHive & $sRegKeyName & "|" & $sRegResults) $i += 1 $iCount += 1 WEnd FileWrite($hFileOpen, _ArrayToString($a_RegReadUninstall, $sSeparator) & @CRLF) EndFunc
    1 point
×
×
  • Create New...