scriptkitty Posted November 12, 2004 Posted November 12, 2004 (edited) Ok, I have been trying to make a window list with the new DLL calls, but I am a bit stumped. Any chance of a simple DDL call to do it? Playing around, I came across this just for fun bit of code. Funny to see all the different handles lying around. I put the stop in because I realised it would take a long time. wasn't a lot after 60000 anyhow... AutoItSetOption("WinTitleMatchMode", 4);2 = Match any substring in the title $x = DLLCall("user32.dll","hwnd","GetDesktopWindow") $x = DLLCall("user32.dll","hwnd","GetWindow","hwnd",$x[0],"int",5) While 1 $x = DLLCall("user32.dll","hwnd","GetWindow","hwnd",$x[0],"int",2) If WinGetTitle("handle="&$x[0])<>"" Then MsgBox(1,$x[0],WinGetTitle("handle="&$x[0]) ) If String($x[0]) = "00000000" Then ExitLoop Wend Updated the code after I saw how to actually use Getwindow. Edited November 12, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers.
this-is-me Posted November 12, 2004 Posted November 12, 2004 Larry's Post: http://www.autoitscript.com/forum/index.php?showtopic=5764 Who else would I be?
scriptkitty Posted November 12, 2004 Author Posted November 12, 2004 Nice I was way off, I didn't realize it was returning an array when I used them, lol AutoItSetOption("WinTitleMatchMode", 4);2 = Match any substring in the title $h = GetWindowHandles() $dataout="" For $i = 1 to $h[0] $title=WinGetTitle("handle="&$h[$i]) $dataout=$dataout&$h[$i]&"--->"&$title& @CRLF Next MsgBox(1,"Windows",$dataout) Func GetWindowHandles() $GW_HWNDNEXT = 2 $GW_CHILD = 5 Dim $List[1] $List[0]=0 $x = DLLCall("user32.dll","hwnd","GetDesktopWindow") if @error Then Return $List $x = DLLCall("user32.dll","hwnd","GetWindow","hwnd",$x[0],"int",$GW_CHILD) if @error Then Return $List While 1 $x = DLLCall("user32.dll","hwnd","GetWindow","hwnd",$x[0],"int",$GW_HWNDNEXT) if @error Then ExitLoop If String($x[0]) = "00000000" Then ExitLoop If BitAnd(WinGetState($x[0]),2) Then $ub = Ubound($List) Redim $List[$ub+1] $List[$ub]=$x[0] $List[0]=$ub EndIf WEnd Return $List EndFunc AutoIt3, the MACGYVER Pocket Knife for computers.
Administrators Jon Posted November 12, 2004 Administrators Posted November 12, 2004 I promise I am absolutely going to do a WinGetList next, maybe tomorrow. Well at least make a start. Well think about making a start.
Administrators Jon Posted November 13, 2004 Administrators Posted November 13, 2004 ( inside Jon's mind ) byoo byoo... grrrrrrrrr ...byoo byoo .... pshooooo... booom... "oh no, health at 30%" ... byooo byooo.. vrrrroooommm... byoo byooLar.
Administrators Jon Posted November 13, 2004 Administrators Posted November 13, 2004 I promise I am absolutely going to do a WinGetList next, maybe tomorrow. Well at least make a start. Well think about making a start. Told you I would.
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