ToJ Posted August 14, 2020 Posted August 14, 2020 Hello I have so far only worked with Autoit on a basic level as that have been enough for my needs. Im working with a program (PSDiag) thats resisting me trying to auto it. In this case i try but cant check if the program is open or activate it to perform any actions. Have tried the basics and even tested with HwdWrapper and REGEXPCLASS that over my head it seems. I have not included any code as its now a mess of not working attempts, i have a feeling its easy when you know how it should be done. Added a Window info as that's what i think can help, if any more is required please tell me and i will try to provide Hope anyone can help /Joshen
mikell Posted August 14, 2020 Posted August 14, 2020 This should work $hWnd = WinActivate("[REGEXPCLASS:(?i)HwndWrapper\[PSDiag.*]") Msgbox(0, "handle", ($hWnd = 0) ? "error" : $hWnd)
Denver Posted August 14, 2020 Posted August 14, 2020 What exactly do you want to "AutoIT" on it? If you want to WinActivate it: WinActivate("[CLASS:HwndWrapper]", "") If you want to WinGetProcess it: $a_ProcessList = ProcessList("PSDiag.exe") $a_WinList = WinList() ;WinGetProcess could be a nice addition to each WinList() results. Dim $a_ProcessGetWin[1][4] = [[0, 0, 0, 0]] For $i = 1 To $a_ProcessList[0][0] ;In the processlist For $j = 1 To $a_WinList[0][0] ;In the winList If WinGetProcess($a_WinList[$j][1]) = $a_ProcessList[$i][1] Then ;AddWin $a_ProcessGetWin[0][0] += 1 ReDim $a_ProcessGetWin[$a_ProcessGetWin[0][0] + 1][UBound($a_ProcessGetWin, 2)] $a_ProcessGetWin[$a_ProcessGetWin[0][0]][0] = $a_ProcessList[$i][0] $a_ProcessGetWin[$a_ProcessGetWin[0][0]][1] = $a_ProcessList[$i][1] $a_ProcessGetWin[$a_ProcessGetWin[0][0]][2] = $a_WinList[$j][0] $a_ProcessGetWin[$a_ProcessGetWin[0][0]][3] = $a_WinList[$j][1] EndIf Next Next ;$a_ProcessGetWin has you covered #include <Array.au3> _ArrayDisplay($a_ProcessGetWin, "$a_ProcessGetWin")
ToJ Posted August 14, 2020 Author Posted August 14, 2020 I knew it! Wonder what i did wrong. Is there any good place that show how all this works in detail as i apparently dont understand it, (thats obvious), the help sections didn't do it for me A big thanks, now i can get into hacking this thing again
Zedna Posted August 14, 2020 Posted August 14, 2020 Maybe https://www.autoitscript.com/autoit3/docs/intro/windowsadvanced.htm Resources UDF ResourcesEx UDF AutoIt Forum Search
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now