Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/16/2025 in Posts

  1. ... Fun topic ... 🙂 just for fun, here are some tweaks to @argumentum's script above to simulate dragging the window and see the visual effect of the movement under the icons...nice effect. To make the window follow the mouse, press F9 once; to stop the movement, press F9 again. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <WinAPISysWin.au3> Opt("MustDeclareVars", True) HotKeySet("{ESC}", Terminate) ;;; https://www.autoitscript.com/forum/topic/212981-move-window-behind-desktop-icons/page/2/#findComment-1544435 HotKeySet('{F9}', F9) ; <-- Global $bFlag = False ; <-- Example() Func Example() Local $hWorkerW = 0, $hProgman = _WinAPI_GetShellWindow() ; WinGetHandle("[CLASS:Progman]") ;~ _SendMessage($hProgman, 0x052C) ; <<<<<< force the creation of a WorkerW handle under Progman ; https://stackoverflow.com/questions/56132584/draw-on-windows-10-wallpaper-in-c ; https://stackoverflow.com/questions/34952967/drawing-to-the-desktop-via-injection ; https://github.com/rocksdanister/lively/issues/2074 _WinAPI_SendMessageTimeout($hProgman, 0x052C, 0, 0, 3000, $SMTO_NORMAL) ; same as _SendMessage() If Not $hWorkerW Then ; dah Local $aEnumWindows = _WinAPI_EnumWindows(False) For $n = 1 To UBound($aEnumWindows) - 1 If $aEnumWindows[$n][1] <> "WorkerW" Then ContinueLoop If _WinAPI_GetParent($aEnumWindows[$n][0]) = $hProgman Then $hWorkerW = $aEnumWindows[$n][0] ExitLoop ; but is likely one at the end of the Z-order EndIf Next EndIf ConsoleWrite("WorkerW = " & $hWorkerW & @CRLF) If Not $hWorkerW Then $hWorkerW = $hProgman Local $hGUI = GUICreate("Overlay", 400, 300, 10, 10) ; , $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)) & "Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 180) GUISetState(@SW_SHOWNOACTIVATE) While GUIGetMsg() <> $GUI_EVENT_CLOSE If $bFlag Then WinMove($hGUI,'',MouseGetPos(0),MouseGetPos(1)) EndIf WEnd EndFunc ;==>Example Func Terminate() Exit EndFunc ;==>Terminate Func F9() $bFlag = Not $bFlag EndFunc
    4 points
  2. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <WinAPISysWin.au3> Opt("MustDeclareVars", True) HotKeySet("{ESC}", Terminate) ;;; https://www.autoitscript.com/forum/topic/212981-move-window-behind-desktop-icons/page/2/#findComment-1544435 Example() Func Example() Local $hWorkerW = 0, $hProgman = _WinAPI_GetShellWindow() ; WinGetHandle("[CLASS:Progman]") ;~ _SendMessage($hProgman, 0x052C) ; <<<<<< force the creation of a WorkerW handle under Progman ; https://stackoverflow.com/questions/56132584/draw-on-windows-10-wallpaper-in-c ; https://stackoverflow.com/questions/34952967/drawing-to-the-desktop-via-injection ; https://github.com/rocksdanister/lively/issues/2074 _WinAPI_SendMessageTimeout($hProgman, 0x052C, 0, 0, 3000, $SMTO_NORMAL) ; same as _SendMessage() If Not $hWorkerW Then ; dah Local $aEnumWindows = _WinAPI_EnumWindows(False) For $n = 1 To UBound($aEnumWindows) - 1 If $aEnumWindows[$n][1] <> "WorkerW" Then ContinueLoop If _WinAPI_GetParent($aEnumWindows[$n][0]) = $hProgman Then $hWorkerW = $aEnumWindows[$n][0] ExitLoop ; but is likely one at the end of the Z-order EndIf Next EndIf ConsoleWrite("WorkerW = " & $hWorkerW & @CRLF) If Not $hWorkerW Then $hWorkerW = $hProgman Local $hGUI = GUICreate("Overlay", 400, 300, 10, 10) ; , $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)) & "Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 180) GUISetState(@SW_SHOWNOACTIVATE) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd EndFunc ;==>Example Func Terminate() Exit EndFunc ;==>Terminate My take on the problem is creating "WorkerW". Finding it with _WinAPI_EnumWindows() works best. Reading this github.com/rocksdanister/lively/issues/2074 ( and the projects ) look interesting.
    4 points
  3. Hey, got it working on Win10. Never expected it. Found some code about forcing the creation of a WorkerW handle. Let's see if it does the job for your too. #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> Opt("MustDeclareVars", True) HotKeySet("{ESC}", Terminate) Example() Func Example() Local $hProgman = WinGetHandle("[CLASS:Progman]") _SendMessage($hProgman, 0x052c) ; <<<<<< force the creation of a WorkerW handle under Progman Local $aList = WinList(), $hWorkerW For $i = 1 To $aList[0][0] If _WinAPI_GetParent($aList[$i][1]) = $hProgman And _WinAPI_GetClassName($aList[$i][1]) = "WorkerW" Then $hWorkerW = $aList[$i][1] ExitLoop EndIf Next ConsoleWrite("WorkerW " & $hWorkerW & @CRLF) Local $hGUI = GUICreate("Overlay", 400, 300, 10, 10, $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 180) GUISetState(@SW_SHOWNOACTIVATE) While Sleep(100) WEnd EndFunc ;==>Example Func Terminate() Exit EndFunc ;==>Terminate
    4 points
  4. I can only test on my Notebook with Win11 24H2 and the solution was to set parent to the WorkerW handle under Progman. I found also the information after midnight to force WorkerW under Progman using DllCall("user32.dll", "lresult", "SendMessage","hwnd", $hProgman, "uint", 0x052C, "wparam", 0, "lparam", 0) but I was too sleepy to continue. ;Code by UEZ build 2025-07-18 beta #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;~ #include <WinAPIGdi.au3> ;~ #include <Array.au3> Global $aPrimary = GetPrimaryMonitorCoords() If @error Then Exit MsgBox(16, "Error", "Unable to get primary monitor") Global $hProgman = WinGetHandle("[CLASS:Progman]"), $hWorkerW, $i If Not $hProgman Then Exit MsgBox(16, "ERROR", "Couldn't find Progman", 30) _WinAPI_SendMessageTimeout($hProgman, 0x052C, 0, 0, 250, $SMTO_NORMAL) ;~ DllCall("user32.dll", "lresult", "SendMessage","hwnd", $hProgman, "uint", 0x052C, "wparam", 0, "lparam", 0) ;~ Sleep(250) ;~ $i = 1 ;~ While True ;~ $h = WinGetHandle("[CLASS:WorkerW;INSTANCE:" & $i & "]") ;~ $hWorkerW = _WinAPI_FindWindowEx($hProgman, $h, "WorkerW") ;~ If $hWorkerW Then ExitLoop ;~ $i += 1 ;~ If $i = 100 Then Exit MsgBox(16, "ERROR", "Couldn't find WorkerW under Progman", 30) ;~ WEnd Global $hWorkerW = _WinAPI_FindWindowEx($hProgman, 0, "WorkerW", "") If $hWorkerW = 0 Then Exit MsgBox(16, "ERROR", "Couldn't find WorkerW under Progman", 30) Local $aOrigin = GetDesktopOrigin() Local $iX = $aPrimary[0] - $aOrigin[0] Local $iY = $aPrimary[1] - $aOrigin[1] Global $hGUI = GUICreate("GUI behind Desktop icons", $aPrimary[4], $aPrimary[5], $iX, $iY, $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, $aPrimary[4], $aPrimary[5]) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowPos($hGUI, $HWND_BOTTOM, 0, 0, 0, 0, BitOR($SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOACTIVATE)) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED, $WS_EX_TRANSPARENT)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 220, $LWA_ALPHA) GUISetState(@SW_SHOWNOACTIVATE, $hGUI) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func _WinAPI_FindWindowEx($hParent, $hAfter, $sClass, $sTitle = "") Local $ret = DllCall("user32.dll", "hwnd", "FindWindowExW", "hwnd", $hParent, "hwnd", $hAfter, "wstr", $sClass, "wstr", $sTitle) If @error Or Not IsArray($ret) Then Return 0 Return $ret[0] EndFunc ;==>_WinAPI_FindWindowEx Func GetPrimaryMonitorCoords() Local $tPoint = DllStructCreate("int x;int y") $tPoint.x = 0 $tPoint.y = 0 Local $hMonitor = _WinAPI_MonitorFromPoint($tPoint, $MONITOR_DEFAULTTOPRIMARY) If Not $hMonitor Then Return SetError(1, 0, 0) Local $tMI = DllStructCreate("dword cbSize;long rcMonitor[4];long rcWork[4];dword dwFlags") DllStructSetData($tMI, "cbSize", DllStructGetSize($tMI)) Local $aCall = DllCall("user32.dll", "bool", "GetMonitorInfoW", "handle", $hMonitor, "ptr", DllStructGetPtr($tMI)) If @error Or Not $aCall[0] Then Return SetError(2, 0, 0) Local $iLeft = $tMI.rcMonitor(1) Local $iTop = $tMI.rcMonitor(2) Local $iRight = $tMI.rcMonitor(3) Local $iBottom = $tMI.rcMonitor(4) Local $iWidth = $iRight - $iLeft Local $iHeight = $iBottom - $iTop Local $a[6] = [$iLeft, $iTop, $iRight, $iBottom, $iWidth, $iHeight] Return $a EndFunc ;==>GetPrimaryMonitorCoords Func GetDesktopOrigin() Local $minX = 0, $minY = 0, $x, $y Local $i = 0, $tDevice, $aRet, $tDevMode, $aED While True $tDevice = DllStructCreate("dword cb; char DeviceName[32]; char DeviceString[128]; dword StateFlags; char DeviceID[128]; char DeviceKey[128]") $tDevice.cb = DllStructGetSize($tDevice) $aRet = DllCall("user32.dll", "bool", "EnumDisplayDevicesA", "ptr", 0, "dword", $i, "ptr", DllStructGetPtr($tDevice), "dword", 0) If @error Or Not $aRet[0] Then ExitLoop If BitAND($tDevice.StateFlags, 1) Then $tDevMode = DllStructCreate( _ "byte dmDeviceName[32]; word dmSpecVersion; word dmDriverVersion; word dmSize; word dmDriverExtra; dword dmFields;" & _ "long dmPositionX; long dmPositionY; dword dmDisplayOrientation; dword dmDisplayFixedOutput;" & _ "short dmColor; short dmDuplex; short dmYResolution; short dmTTOption; short dmCollate; char dmFormName[32];" & _ "ushort dmLogPixels; dword dmBitsPerPel; dword dmPelsWidth; dword dmPelsHeight;" & _ "dword dmDisplayFlags; dword dmDisplayFrequency; dword dmICMMethod; dword dmICMIntent;" & _ "dword dmMediaType; dword dmDitherType; dword dmReserved1; dword dmReserved2; dword dmPanningWidth; dword dmPanningHeight") $tDevMode.dmSize = DllStructGetSize($tDevMode) $aED = DllCall("user32.dll", "bool", "EnumDisplaySettingsA", "str", $tDevice.DeviceName, "dword", -1, "ptr", DllStructGetPtr($tDevMode)) If Not @error And $aED[0] Then $x = $tDevMode.dmPositionX $y = $tDevMode.dmPositionY If $x < $minX Then $minX = $x If $y < $minY Then $minY = $y EndIf EndIf $i += 1 WEnd Local $a[2] = [$minX, $minY] Return $a EndFunc ;==>GetDesktopOrigin
    3 points
  5. I set a good challenge, it's giving good results I told @UEZ to come, he comes in like Superman 🤣
    2 points
  6. 1.8.6 released! Only one change, the help box that appears when writing function parameters should not dissapear, when adding "," anymore. It took me a while and the solution is not perfect, but it should be better than the previous experience
    2 points
  7. Technically, it can be launched separately without geckodriver, but the correct parameters need to be utilized so that it behaves the same as when launched via the webdriver. I don't remember the exact parameters, but I used to do this so I know it is possible. I think a search of the forum (and maybe the wiki) would provide the information.
    1 point
  8. Have you ever encountered the problem of blocking the browser profile directory created by WebDriver? I have such problem from about 2 weeks with some version of ESET solutions. You can test it with "wd_demo.au3" with this modified SetupGecko() Func SetupGecko($bHeadless) _WD_Option('Driver', 'geckodriver.exe') Local $iPort = _WD_GetFreePort(4444, 4500) If @error Then Return SetError(@error, @extended, 0) _WD_Option('Port', $iPort) _WD_Option('DriverParams', '--port=' & $iPort & ' --log trace --marionette-port 2828') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'firefox') _WD_CapabilitiesAdd('browserName', 'firefox') _WD_CapabilitiesAdd('acceptInsecureCerts', True) ; REMARKS ; When using 32bit geckodriver.exe, you may need to set 'binary' option. ; This shouldn't be needed when using 64bit geckodriver.exe, ; but at the same time setting it is not affecting the script. Local $sPath = _WD_GetBrowserPath("firefox") If Not @error Then _WD_CapabilitiesAdd('binary', $sPath) ConsoleWrite("wd_demo.au3: _WD_GetBrowserPath() > " & $sPath & @CRLF) EndIf Local $s_Browser_Profile_Dir = @TempDir & '\Firefox_WD_Testing_Profile' DirCreate($s_Browser_Profile_Dir) __WD_ConsoleWrite($s_Browser_Profile_Dir) Sleep(3000) _WD_CapabilitiesAdd('args', '-profile') _WD_CapabilitiesAdd('args', $s_Browser_Profile_Dir) ; CHANGE TO PROPER DIRECTORY PATH If $bHeadless Then _WD_CapabilitiesAdd('args', '--headless') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sCapabilities = _WD_CapabilitiesGet() Return $sCapabilities EndFunc ;==>SetupGecko or this modified SetupChrome() Func SetupChrome($bHeadless) _WD_Option('Driver', 'chromedriver.exe') Local $iPort = _WD_GetFreePort(5555, 5600) If @error Then Return SetError(@error, @extended, 0) _WD_Option('Port', $iPort) Local $sTimeStamp = @YEAR & '-' & @MON & '-' & @MDAY & '_' & @HOUR & @MIN & @SEC _WD_Option('DriverParams', '--port=' & $iPort & ' --verbose --log-path="' & @ScriptDir & '\' & $sTimeStamp & '_chrome.log"') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('browserName', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('acceptInsecureCerts', True) ;~ https://peter.sh/experiments/chromium-command-line-switches/ _WD_CapabilitiesAdd('detach', False) _WD_CapabilitiesAdd('args', 'user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win' & StringReplace(@OSArch, 'X', '') & '; ' & @CPUArch & ') AppleWebKit/537.36 (KHTML, like Gecko) Chrome/' & _WD_GetBrowserVersion('chrome') & ' Safari/537.36') _WD_CapabilitiesAdd('args', 'user-data-dir', @TempDir & '\Chrome_WD_Testing_Profile4') _WD_CapabilitiesAdd('args', '--profile-directory', Default) If $bHeadless Then _ _WD_CapabilitiesAdd('args', '--headless') If IsAdmin() Then _ _WD_CapabilitiesAdd('args', '--do-not-de-elevate') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sCapabilities = _WD_CapabilitiesGet() Return $sCapabilities EndFunc ;==>SetupChrome What are my results? First run ALL IS OK Each subsequent run gives: or
    1 point
  9. You can chceck it also with standard SetupGecko() and stanard SetupChrome() but in such case you must to search for c:\Users\****\AppData\Local\Temp\chrome_url_fetcher_**** c:\Users\****\AppData\Local\Temp\rust_mozprofile**** c:\Users\****\AppData\Local\Temp\edge_BITS_**** and try to delete this directories after they are created by WebDriver (of course after you finish/stop your automation script) in such case you will notice that you may be not abloe to delete such directory as ESET AV is blocking them. Turning off HIPS module in ESET AV and restarting PC fix this issue but it is not recomended to turn of HIPS module. I am in contact with the developer of this antivirus software, but so far there is no indication of a positive solution to the problem.
    1 point
  10. The older attachments have now been removed and the latest ones have been added to the first post. 👍
    1 point
  11. I saw 1 under explorer.exe an was hidden. Didn't try elsewhere because am busy and the problem is in Win11 24H2 anyway.
    1 point
  12. @argumentum i use https://www.nirsoft.net/utils/gui_prop_view.html
    1 point
  13. I've come this far, I'm struggling to figure out how to set the transparency. Testet in Win10 22H2 #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WinAPISysInternals.au3> #include <WindowsConstants.au3> ; Getting the right WorkerW window Global $hWorkerW = _FindWorkerW_WithStyles() ConsoleWrite("$hWorkerW=" & $hWorkerW & @CRLF) If Not $hWorkerW Then Exit ConsoleWrite("! Error Could not find WorkerW window." & @CRLF) Main() Func Main() Local $this = GUICreate("", 400, 400, @DesktopWidth - (400) - 20, 100, $WS_POPUP, $WS_EX_NOACTIVATE) ;~ WinSetTrans($this, "", 200) ; not working GUISetBkColor(0x000000) Local $iPic = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 0, 0) GUISetState(@SW_SHOW) ; Changes the parent window _WinAPI_SetParent($this, $hWorkerW) WinSetTrans($this, "", 100) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($this) EndFunc ;==>Main Func _FindWorkerW_WithStyles($iWidth = @DesktopWidth, $iHeight = @DesktopHeight) ; Getting the right WorkerW window with criteria ; size: 1920, 1080 ; visible: Yes ; style: Popup,Tool Window,Transparent Local $aList = WinList("[CLASS:WorkerW]") For $i = 1 To $aList[0][0] Local $hWnd = $aList[$i][1] If Not IsHWnd($hWnd) Then ContinueLoop ; Get visibility If Not BitAND(WinGetState($hWnd), 2) Then ContinueLoop ; Get position and size Local $aPos = WinGetPos($hWnd) If @error Then ContinueLoop If $aPos[2] <> $iWidth Or $aPos[3] <> $iHeight Then ContinueLoop ; Get styles Local $nStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) ; $GWL_STYLE Local $nExStyle = _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE) ; $GWL_EXSTYLE ; Check for required style flags If BitAND($nStyle, $WS_POPUP) = $WS_POPUP _ And BitAND($nExStyle, $WS_EX_TOOLWINDOW) = $WS_EX_TOOLWINDOW _ And BitAND($nExStyle, $WS_EX_TRANSPARENT) = $WS_EX_TRANSPARENT Then Return $hWnd EndIf Next Return 0 ; Not found EndFunc ;==>_FindWorkerW_WithStyles
    1 point
  14. It provides one of the WorkerW handles, not the WorkerW handle under Progman. 😉 This works for me: ;Code by UEZ build 2025-07-16 beta #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $hProgman = WinGetHandle("[CLASS:Progman]"), $hWorkerW, $i $i = 1 While True $h = WinGetHandle("[CLASS:WorkerW;INSTANCE:" & $i & "]") $hWorkerW = _WinAPI_FindWindowEx($hProgman, $h, "WorkerW", "") If $hWorkerW Then ExitLoop $i += 1 If $i = 100 Then Exit MsgBox(16, "ERROR", "Couldn't find WorkerW under Progman", 30) WEnd Global $SWP = BitOR($SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOACTIVATE) $hGUI = GUICreate("Overlay", 400, 300, 10, 10, $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowPos($hGUI, $HWND_BOTTOM, 0,0,0,0, $SWP) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED, $WS_EX_TRANSPARENT)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 220, $LWA_ALPHA) GUISetState(@SW_SHOWNOACTIVATE, $hGUI) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func _WinAPI_FindWindowEx($hParent, $hAfter, $sClass, $sTitle = "") Local $ret = DllCall("user32.dll", "hwnd", "FindWindowExW", "hwnd", $hParent, "hwnd", $hAfter, "wstr", $sClass, "wstr", $sTitle) If @error Or Not IsArray($ret) Then Return 0 Return $ret[0] EndFunc
    1 point
  15. I've looked at incorporating stuff into the script to not have to include more #includes but is a rabbit's hole and each #include, have their #includes... . I'll look at it deeper when I get more time to fiddle with them. Do remove the other post with attachments as they are not needed ( not the post but the attachments )
    1 point
  16. I found a way in Win11 24H2 Spy++: but I couldn't find a way to get WorkerW handle by searching from Progman. I will continue tomorrow...
    1 point
  17. @Tippex, I made a bug in my most masterful creation Please look at the "✨new and improved✨" code, and patch with that 😅 Edit: the GUICtrlCreateLabel("@ArrayDisplayInternals@GUIidentifier@", 0, -10, 0, 0) is to aid some people that keep a bunch of these open and need to close them in bulk. That's the reason for the hidden label.
    1 point
  18. ...if you read some comments in the scripts you'll see some "; #DUPLICATED Functions to avoid big #include ..." because the idea is to make it light ( as in how heavy is to load HTML concept ). And that's the reason that I can not push for these in the standard distribution. I did add the WinSetOnTop($hGUI, "", 1) WinSetOnTop($hGUI, "", 0) because is light and does serve a needed "fix" for it not opening in the foreground at times. For the rest of the goodies, if anyone cares, the "deluxe models" are here Thanks for the updates @Tippex
    1 point
  19. ..time files Do add the patch from there:
    1 point
  20. The file you posted is not the updated one. Things like "If $iFlags = Default Then $iFlags = $__g_ArrayDisplay_Share_iFlags" are not there @Tippex. Global Const $ARRAYDISPLAY_NODATALABELDISPLAY = 256 ; 128 <-- is taken; No data label displayed I also added: Global Const $ARRAYDISPLAY_NoRightClick = 512 ... ... Local $iRightClickClipPut = True If BitAND($iFlags, $ARRAYDISPLAY_NoRightClick) = $ARRAYDISPLAY_NoRightClick Then $iRightClickClipPut = False ... ... Case $GUI_EVENT_SECONDARYUP If $iRightClickClipPut Then __ArrayDisplay_SubItemHitTest_ClipPut($idListView) to the version.
    1 point
  21. Documentation for _DateDiff() says: And today, for the first time, I noticed that this function lacks (at least for me) one possibility - return the total time difference in the format in which the start and end dates were given. Do you have any way or do you see here on the forum an working example which will return such results: _DateDiff('full', "2021/09/01 08:00:00", "2021/09/01 15:58:00") ; >>> "0000/00/00 07:58:00" _DateDiff('full', "2021/09/01 08:00:00", "2021/09/05 15:58:00") ; >>> "0000/00/05 07:58:00" _DateDiff('full', "2021/01/01 08:00:00", "2021/09/05 15:58:00") ; >>> "0000/09/05 07:58:00" _DateDiff('full', "2020/01/01 08:00:00", "2021/09/05 15:58:00") ; >>> "0001/09/05 07:58:00" I will try to answer the standard questions asked in such cases: I haven't done anything myself yet, I just have a concept in my head, but I wanted to see if something like this had been done before. Yes I tried to find this solution here on the forum for about 1 hour. Regards, @mLipok EDIT: I rolled up my sleeves and set to work on solving this problem. So far I have something like in the following snippet: Func _DateDiff_FullTime($sStartDate, $sEndDate) Local $iSeconds = _DateDiff('s', $sStartDate, $sEndDate) Local $sDate = _DateAdd('s', $iSeconds, '1000/01/01 00:00:00') Local $asTimePart[4] Local $asDatePart[4] _DateTimeSplit($sDate, $asDatePart, $asTimePart) Local $iYear = $asDatePart[1], $iMonth = $asDatePart[2], $iDay = $asDatePart[3] Local $iHours = $asTimePart[1], $iMins = $asTimePart[2], $iSecs = $asTimePart[3] $iYear = Number($iYear) - 1 $iMonth = Number($iMonth) - 1 $iDay = Number($iDay) - 1 Local $sFullTimeDifference = '0000' & '/' & $iMonth & '/' & $iDay & ' ' & $iHours & ':' & $iMins & ':' & $iSecs ConsoleWrite("! $sFullTimeDifference = " & $sFullTimeDifference & @CRLF) Return $sFullTimeDifference EndFunc ;==>_DateDiff_FullTime I know it's not perfect yet, but I'm working on it. If I encounter a problem, I will ask additional questions, and when I finish, I will share the result. I'm going back to work. Now it produce such example results (not related to the opening example )
    1 point
  22. If you want the difference between two dates expressed in years, months, days, hours, minutes and seconds, this little _ElapsedTime() function can be useful for you. It returns an array with those results in its elements, that you can then format as you better like... (maybe it can be shorten a bit) (something similar already diascussed here.... https://www.autoitscript.com/forum/topic/206014-autoit-calculates-date/?do=findComment&comment=1483698) #include <Date.au3> Local $Start = "2020/01/01 08:00:00" ; "1962/05/02" & " " & "00:00:00" ; _NowTime(); start date Local $Stop = "2021/09/05 15:58:00" ; _NowCalc() ; _NowCalcDate() ; end date Local $aElapsed = _ElapsedTime($Start, $Stop) ; MsgBox(0, "Elapsed Time", $aElapsed[0] & " years, " & $aElapsed[1] & " months, " & $aElapsed[2] & " days, " & $aElapsed[3] & " hours, " & $aElapsed[4] & " minutes, " & $aElapsed[5] & " seconds") ConsoleWrite("Elapsed Time from " & $Start & " to " & $Stop & " : " & $aElapsed[0] & " years, " & $aElapsed[1] & " months, " & $aElapsed[2] & " days, " & $aElapsed[3] & " hours, " & $aElapsed[4] & " minutes, " & $aElapsed[5] & " seconds" & @CRLF) ; returns an array with the elapsed time between 2 dates expressed in years, months, days, hours, minutes, seconds Func _ElapsedTime($sStartDate, $sEndDate) Local Enum $iYears, $iMonths, $iDays, $iHours, $iMinutes, $iSeconds Local $aResult[6] ; $aResult[$iYears] = _DateDiff('Y', $sStartDate, $sEndDate) $aResult[$iMonths] = _DateDiff('M', _DateAdd('Y', $aResult[$iYears], $sStartDate), $sEndDate) $aResult[$iDays] = _DateDiff('D', _DateAdd('M', $aResult[$iMonths], _DateAdd('Y', $aResult[$iYears], $sStartDate)), $sEndDate) $aResult[$iHours] = _DateDiff('h', _DateAdd('D', $aResult[$iDays], _DateAdd('M', $aResult[$iMonths], _DateAdd('Y', $aResult[$iYears], $sStartDate))), $sEndDate) $aResult[$iMinutes] = _DateDiff('n', _DateAdd('h', $aResult[$iHours], _DateAdd('D', $aResult[$iDays], _DateAdd('M', $aResult[$iMonths], _DateAdd('Y', $aResult[$iYears], $sStartDate)))), $sEndDate) $aResult[$iSeconds] = _DateDiff('s', _DateAdd('n', $aResult[$iMinutes], _DateAdd('h', $aResult[$iHours], _DateAdd('D', $aResult[$iDays], _DateAdd('M', $aResult[$iMonths], _DateAdd('Y', $aResult[$iYears], $sStartDate))))), $sEndDate) Return $aResult ; [0] years; [1] months; [2] days; [3] hours; [4] minutes; [5] seconds EndFunc ;==>_ElapsedTime
    1 point
  23. ...so, I'm happy coding and watching the array and I'd like to ClipPut the value in the cell. Not the row, just the cell. So I added that, if one is to right click the cell, it puts the value on the clipboard. Attached is ArrayDisplayInternals.au3 for AutoIt v3.3.14.5 PS: do not overwrite the original file as this one is not supported by the AutoIt Team. ArrayDisplayInternals.au3
    1 point
  24. I agree and added for my use _DebugArrayDisplay_DefaultFlags(). ... ... Global $__g_ArrayDisplay_Share_iFlags = 0 Func _DebugArrayDisplay_DefaultFlags($iFlags = 0) $__g_ArrayDisplay_Share_iFlags = $iFlags EndFunc Func __ArrayDisplay_Share(Const ByRef $aArray, $sTitle = Default, $sArrayRange = Default, $iFlags = Default, $vUser_Separator = Default, $sHeader = Default, $iMax_ColWidth = Default, $hUser_Function = Default, $bDebug = True) Local $vTmp, $sMsgBoxTitle = (($bDebug) ? ("DebugArray") : ("ArrayDisplay")) ; Default values If $sTitle = Default Then $sTitle = $sMsgBoxTitle If $sArrayRange = Default Then $sArrayRange = "" If $iFlags = Default Then $iFlags = 0 If $vUser_Separator = Default Then $vUser_Separator = "" If $sHeader = Default Then $sHeader = "" If $iMax_ColWidth = Default Then $iMax_ColWidth = 350 If $hUser_Function = Default Then $hUser_Function = 0 If $__g_ArrayDisplay_Share_iFlags And $bDebug And Not $iFlags Then $iFlags = $__g_ArrayDisplay_Share_iFlags ... ... and I placed it in my Template.au3 as ... ... #include <Debug.au3> If @Compiled Then _DebugArrayDisplay_DefaultFlags(BitOR($ARRAYDISPLAY_ONLYCOPYBUTTONS, $ARRAYDISPLAY_NODATALABELDISPLAY)) ... ...
    1 point
  25. Hello there, i`m really sorry to necropost or if this is not relevant anymore, just thought someone else might find this helpful, here`s an old UDF for communication with MikroTik devices, hope it helps someone @krypt022 _mikrotik_UDF.au3
    1 point
×
×
  • Create New...