JohnBailey Posted October 11, 2007 Posted October 11, 2007 How do I get a window title using the a windows handler (Hwnd)? A decision is a powerful thing
PsaltyDS Posted October 11, 2007 Posted October 11, 2007 How do I get a window title using the a windows handler (Hwnd)?$sTitle = WinGetTitle($hWin)AutoIt will take a handle in place of the title string to specify a window. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
JohnBailey Posted October 11, 2007 Author Posted October 11, 2007 $sTitle = WinGetTitle($hWin)AutoIt will take a handle in place of the title string to specify a window. OH! I had no idea! I never saw anything about that in the help! Thank you! A decision is a powerful thing
Blue_Drache Posted October 11, 2007 Posted October 11, 2007 And I'm the first person to use the hwnd of a window instead of the title...Titles are mutable and can change. The hwnd does not. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
JohnBailey Posted October 11, 2007 Author Posted October 11, 2007 And I'm the first person to use the hwnd of a window instead of the title...Titles are mutable and can change. The hwnd does not.oh absolutely that's a part of the reason why I'm wanting to use them A decision is a powerful thing
Blue_Drache Posted October 11, 2007 Posted October 11, 2007 Just be sure to set Opt("WinTitleMatchMode",4) Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
JohnBailey Posted October 11, 2007 Author Posted October 11, 2007 Just be sure to set Opt("WinTitleMatchMode",4) ? It's working for me without doing that A decision is a powerful thing
PsaltyDS Posted October 11, 2007 Posted October 11, 2007 Just be sure to set Opt("WinTitleMatchMode",4) You don't have to do that to use handles, but you do if you want to use "[CLASS:]" style attributes. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
JohnBailey Posted October 11, 2007 Author Posted October 11, 2007 You don't have to do that to use handles, but you do if you want to use "[CLASS:]" style attributes. PsaltyDS, that's what I was understanding too. A decision is a powerful thing
Moderators SmOke_N Posted October 11, 2007 Moderators Posted October 11, 2007 but you do if you want to use "[CLASS:]" style attributes. Only if you are using the old ways classname=#32770 versus [CLASS:#32770] Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
PsaltyDS Posted October 11, 2007 Posted October 11, 2007 Only if you are using the old ways classname=#32770 versus [CLASS:#32770] Did not realize that... I'm done! Go'n home for the day! Learned my new thing for day! Run("notepad.exe") $i = 0 Do Sleep(20) $hWin = WinGetHandle("[CLASS:Notepad; TITLE:Untitled - Notepad]") $i += 1 Until IsHWnd($hWin) MsgBox(64, "Test", "Got handle in " & $i & " tries.") WinClose($hWin) $hWin = 0 Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Moderators SmOke_N Posted October 11, 2007 Moderators Posted October 11, 2007 Did not realize that... I'm done! Go'n home for the day! Learned my new thing for day! Run("notepad.exe") $i = 0 Do Sleep(20) $hWin = WinGetHandle("[CLASS:Notepad; TITLE:Untitled - Notepad]") $i += 1 Until IsHWnd($hWin) MsgBox(64, "Test", "Got handle in " & $i & " tries.") WinClose($hWin) $hWin = 0 I only found out by someone pointing it out to me the other day... guess I missed the "You don't have to anymore post" as well. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Blue_Drache Posted October 11, 2007 Posted October 11, 2007 Meh, I guess I'm old hat then. I still set advanced, just in case...and I get the benefits of option 2 when I need to match titles. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
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