atomman Posted January 18, 2008 Share Posted January 18, 2008 why do these only work for AutoIt GUI's? Case $GUI_EVENT_PRIMARYDOWN MsgBox(0, "", WinGetTitle("")) or... Case $GUI_EVENT_PRIMARYDOWN MsgBox(0, "", WinGetHandle("")) Link to comment Share on other sites More sharing options...
atomman Posted January 18, 2008 Author Share Posted January 18, 2008 NEVER MIND everyone's allowed one dumb-ass question a day :/ Link to comment Share on other sites More sharing options...
rasim Posted January 18, 2008 Share Posted January 18, 2008 (edited) NEVER MIND everyone's allowed one dumb-ass question a day :/ Easy, easy... MsgBox(0, "", WinGetTitle("")) This code return title of current active window. So if you get MsgId from created GUI, what returned WinGetTitle("")? Title of current active window. Edited January 18, 2008 by rasim Link to comment Share on other sites More sharing options...
BrettF Posted January 18, 2008 Share Posted January 18, 2008 Doesn't he mean the $GUI_EVENT ones? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
martin Posted January 18, 2008 Share Posted January 18, 2008 why do these only work for AutoIt GUI's? Case $GUI_EVENT_PRIMARYDOWN MsgBox(0, "", WinGetTitle("")) or... Case $GUI_EVENT_PRIMARYDOWN MsgBox(0, "", WinGetHandle("")) In case you haven't discovered, I think what you want is #include <misc.au3> while 1 if _IsPressed("1") then MsgBox(0,'current window = ', WinGetTitle("")) Switch GuiGetMsg() case ... . . EndSwitch WEnd Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
FreeFry Posted January 18, 2008 Share Posted January 18, 2008 Gui events only work in your own gui(unless you've hooked into another process by using dll calls n stuff), because autoit only handles gui messages for it's own gui's. Link to comment Share on other sites More sharing options...
atomman Posted January 18, 2008 Author Share Posted January 18, 2008 @martin -- yeah, that's what i want, but my problem is that i have one AU3 GUI which is always on top, so that's the only one i'm getting titles/handles for. i need to ignore all the GUI's created in the script and get the title/handle of the one clicked on. Link to comment Share on other sites More sharing options...
FreeFry Posted January 18, 2008 Share Posted January 18, 2008 I'm sorry, I didn't quite understand that last part, can you explain what exactly you're trying to do? Link to comment Share on other sites More sharing options...
atomman Posted January 18, 2008 Author Share Posted January 18, 2008 i want to WinGetHandle("") (or WinGetTitle("")) of the non-AU3 window which receives a mouse L-click so i have the handle/title to use in further operations. Link to comment Share on other sites More sharing options...
FreeFry Posted January 18, 2008 Share Posted January 18, 2008 Then doing something like this should work: If _IsPressed("1") Then $Handle = WinGetHandle("") Link to comment Share on other sites More sharing options...
martin Posted January 18, 2008 Share Posted January 18, 2008 Then doing something like this should work: If _IsPressed("1") Then $Handle = WinGetHandle("")Yes, as post #5. Maybe If _IsPressed("1") Then if Not( WinActive($gui1) Or Winactive($Gui2) Or WinActive($Gui3)) then $Handle = WinGetHandle("") endif Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
atomman Posted January 18, 2008 Author Share Posted January 18, 2008 ah! sorry guys!i meant i need to get the handle of the non-AU3 window even if the AU3 window is topmost. i stated that in a post earlier, but i didn't carry it over to my last post. sorry.@martin - using your code works fine, but it only returns info from the topmost AU3 window (unless i'm doing something way wrong, because i haven't tested any of this thoroughly yet -- i'm involved in another struggle at the moment Link to comment Share on other sites More sharing options...
FreeFry Posted January 19, 2008 Share Posted January 19, 2008 Hmm, from what I know, the active window doesn't have to be topmost, so the WinGet* using "" as title parameter or [ACTIVE] (advanced title mode), should work... hmm Link to comment Share on other sites More sharing options...
martin Posted January 19, 2008 Share Posted January 19, 2008 (edited) ah! sorry guys! i meant i need to get the handle of the non-AU3 window even if the AU3 window is topmost. i stated that in a post earlier, but i didn't carry it over to my last post. sorry. @martin - using your code works fine, but it only returns info from the topmost AU3 window (unless i'm doing something way wrong, because i haven't tested any of this thoroughly yet -- i'm involved in another struggle at the moment I think I see. Try this example #include <constants.au3> #include <misc.au3> $g1 = GUICreate("top",400,400,0,0,-1,$WS_EX_TOPMOST) GUISetState() while 1 if _IsPressed("1") Then $a = WinGetTitle("") if $a <> "top" then MsgBox(0,'active window is',$a) EndIf If GUIGetMsg() = -3 then exit WEnd For the case where you have 3 AutoIt guis you will need to say something like if $a <> $Title1 And $a <> $Title2 and $a <> $Title3 then $LastActive = $a Edited January 19, 2008 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
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