Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/10/2022 in all areas

  1. @mLipok Following the "See Also" links will lead you to here.
    1 point
  2. Subz

    Get and Set Icon position.

    Does using the file type help (see last post)? You could also use _FileListToArray within _GetShortcutPos() to find all files with $sShortcutName & ".*" to get a list of files with same name, without changing the registry: Local $aShortcuts = _FileListToArrayRec(@DesktopCommonDir, $sShortcutName & ".*", 1, 0, 0)
    1 point
  3. Released v1.0.8 today, here's the updates: Added Open include file from the current line with Alt+i/Command Palette (thanks Danp2) Insert UDF Header function (thanks Danp2) UDF Creator option in Settings to auto populate author when inserting a Function Header AutoIt Map functions (thanks steipal) Colorized output when running scripts (thanks Danp2) Restart script (thanks vanown) Abbreviations from SciTe4AutoIt as Snippets ( is now a trigger character to accept a function completion and will place both parens and initiate signature help for the function. Changed The AutoIt Help command will now open on blank lines (thanks Danp2) Updated the descriptions of the path settings Refactored filepath finding code (thanks Danp2) Fixed Code folding for If, Switch, For, While, With, #comments-start, #cs, #comments-end and #ce (thanks Danp2) Go to Workspace Symbol functionality restored Rate and View on VS Code Marketplace Star & Submit Issues on GitHub
    1 point
  4. Jos

    proper way to update AutoIT

    That is very likely the case, but with option 2. you always have a chance to leave some "old" unused files when they were renamed. I always simply upgrade and never uninstall first..
    1 point
  5. Hello, can you explain how WebDriver works when i do an action on my current Window that open "a child window" that WebDriver will add to the list of the window he handles ? I got some problems with IEDriver, sometimes (randomly) when i do an action that is opening a new window, my program freeze a little bit before the window is created and then, my driver never get the handle of the new window (even 5 minute later when i'm 100% sure it's full loaded). When it happens, i can see in the log that my '_wd_attach' fails because he doesn't handle any window anymore (the first window is closed to open the new one): __WD_Get: URL=HTTP://127.0.0.1:5555/session/aeca4638-12c0-4220-a95d-bf63d8c54cd8/window/handles __WD_Get ==> Success (0) HTTP status = 200 : ResponseText={ "value" : [] } All i can do after that is recreating a new session. In the example bellow, the website i open, automatically close the first window and open a new one to the homepage. When it's done, i try to attach the new one. I did a loop to repeat those action and i got the problem i detailed above almost twice out of the 19 try Example : For $i = 0 To 19 _Setup_IEDriver() $sWDSession = _WD_CreateSession($sDesiredCapabilities) _WD_LoadWait($sWDSession) _WD_Navigate($sWDSession, $sUrl) _WD_LoadWait($sWDSession) For $j = 1 To 100 _WD_Attach($sWDSession, $sUrl & "homepage.do", 'URL') If Not (@error) Then ExitLoop Sleep(300) Next If $j = 101 Then ConsoleWrite("! STOP ERROR ATTACH HOMEPAGE" & @CRLF) EndIf Sleep(500) _WD_DeleteSession($sWDSession) _WD_Shutdown() Sleep(2000) Next Func _Setup_EDGEDriver() _WD_Option('Driver', @ScriptDir & '\include\' & (@Compiled ? '' : 'Exe_externe\') & 'msedgedriver.exe') _WD_Option('Port', 9515) $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"args": []}}}}' _WD_Startup() EndFunc ;==>_Setup_EDGEDriver Edit : It looks like a known bug : https://github.com/SeleniumHQ/selenium/issues/8868
    1 point
  6. Jon

    AutoIt v.3.3.16.0 Released

    AutoIt v3.3.16.0 has been released. Thanks to @jpm and the MVPs who were responsible for the majority of code in this version. Download it here. Complete list of changes: History
    1 point
  7. WinGetProcess is what i was looking for but it only covers the first question. From what you guys gave me, I think i found what i was looking for I'm working on a script to hide all the windows associated with a certain process. Here's what I have so far: Global $processList[4] $processList[0] = 4 $processList[1] = "winword.exe" $processList[2] = "firefox.exe" $processList[3] = "notepad.exe" Func ToggleHideProcess() ; Hides the windows associated with a process from processlist For $y = 1 To $processList[0] $WindowList = getWindowsFromProcess($processList[$y]) If $WindowList <> 0 Then For $x = 1 To $WindowList[0][0] hideWindow($WindowList[$x][0]) Next EndIf Next EndFunc ;==>ToggleHideProcess Func getWindowsFromProcess($Process) $wArray = _WinAPI_EnumProcessWindows(ProcessExists($Process), True) If @error Then Return 0 Else Return $wArray EndIf EndFunc ;==>getWindowFromProcess Func hideWindow($windowHandle) WinSetState($windowHandle, "", @SW_HIDE) EndFunc ;==>hideWindow
    1 point
  8. I hope this helps: #include <Array.au3> #include <WinAPIProc.au3> Global $tag_SYSTEM_THREADS = "double KernelTime;" & _ "double UserTime;" & _ "double CreateTime;" & _ "ulong WaitTime;" & _ "ptr StartAddress;" & _ "dword UniqueProcess;" & _ "dword UniqueThread;" & _ "long Priority;" & _ "long BasePriority;" & _ "ulong ContextSwitchCount;" & _ "long State;" & _ "long WaitReason" Global $tag_SYSTEM_PROCESSES = "ulong NextEntryDelta;" & _ "ulong Threadcount;" & _ "ulong[6];" & _ ; Reserved... "double CreateTime;" & _ "double UserTime;" & _ "double KernelTime;" & _ "ushort Length;" & _ ; unicode string length "ushort MaximumLength;" & _ ; also for unicode string "ptr ProcessName;" & _ ; ptr to mentioned unicode string - name of process "long BasePriority;" & _ "ulong ProcessId;" & _ "ulong InheritedFromProcessId;" & _ "ulong HandleCount;" & _ "ulong[2];" & _ ;Reserved... "uint PeakVirtualSize;" & _ "uint VirtualSize;" & _ "ulong PageFaultCount;" & _ "uint PeakWorkingSetSize;" & _ "uint WorkingSetSize;" & _ "uint QuotaPeakPagedPoolUsage;" & _ "uint QuotaPagedPoolUsage;" & _ "uint QuotaPeakNonPagedPoolUsage;" & _ "uint QuotaNonPagedPoolUsage;" & _ "uint PagefileUsage;" & _ "uint PeakPagefileUsage;" & _ "uint64 ReadOperationCount;" & _ "uint64 WriteOperationCount;" & _ "uint64 OtherOperationCount;" & _ "uint64 ReadTransferCount;" & _ "uint64 WriteTransferCount;" & _ "uint64 OtherTransferCount" Global $hWND , $aResult = _WinAPI_EnumProcesses("Firefox.exe") For $i = 0 To UBound($aResult) - 1 $hWND = _WinAPI_GetHWNDFromPid($aResult[$i][1]) ConsoleWrite("Window handle: " & $hWND & @CRLF) ConsoleWrite("Process name: " & _WinAPI_GetProcessNameFromHWND($hWND) & @CRLF) Next Func _WinAPI_GetHWNDFromPid($iPid) Local $aData = _WinAPI_EnumProcessWindows($iPid, 1) If @error Then Return SetError(1, 0, 0) Return $aData[1][0] EndFunc Func _WinAPI_GetProcessNameFromHWND($hWND, $bFullpath = False) Local $sResult = _WinAPI_GetWindowFileName($hWND) If @error Then Return SetError(1, 0, 0) If $bFullpath Then Return $sResult Return StringRegExpReplace($sResult, ".+\\(.+?)", "$1") EndFunc Func _WinAPI_EnumProcesses($sProcessName = "") ;http://www.autoitscript.com/forum/index.php?showtopic=88934 Local $ret = DllCall("ntdll.dll", "int", "ZwQuerySystemInformation", "int", 5, "int*", 0, "int", 0, "int*", 0) Local $Mem = DllStructCreate("byte[" & $ret[4] & "]") Local $ret = DllCall("ntdll.dll", "int", "ZwQuerySystemInformation", "int", 5, "ptr", DllStructGetPtr($Mem), "int", DllStructGetSize($Mem), "int*", 0) Local $SysProc = DllStructCreate($tag_SYSTEM_PROCESSES, $ret[2]) Local $SysProc_ptr = $ret[2] Local $SysProc_Size = DllStructGetSize($SysProc) Local $SysThread = DllStructCreate($tag_SYSTEM_THREADS) Local $SysThread_Size = DllStructGetSize($SysThread) Local $buffer, $i, $lastthread, $m = 0, $NextEntryDelta, $k, $temp, $space, $l Local $avArray[10000][2] While 1 $buffer = DllStructCreate("char[" & DllStructGetData($SysProc, "Length") & "]", DllStructGetData($SysProc, "ProcessName")) For $i = 0 To DllStructGetData($SysProc, "Length") - 1 Step 2 $avArray[$m][0] &= DllStructGetData($buffer, 1, $i + 1) Next $avArray[$m][1] = DllStructGetData($SysProc, "ProcessId") $NextEntryDelta = DllStructGetData($SysProc, "NextEntryDelta") If Not $NextEntryDelta Then ExitLoop $SysProc_ptr += $NextEntryDelta $SysProc = DllStructCreate($tag_SYSTEM_PROCESSES, $SysProc_ptr) If $sProcessName = "" Then $m += 1 Else If $avArray[$m][0] = $sProcessName Then $m += 1 Else $avArray[$m][0] = "" EndIf EndIf WEnd If $sProcessName <> "" Then $m -= 1 ReDim $avArray[$m + 1][2] Return $avArray EndFunc
    1 point
  9. The file that is used when you right-click in Explorer and New > Autoit v3 Script? That would be C:\Windows\ShellNew\Template.au3
    1 point
×
×
  • Create New...