therks Posted February 5, 2007 Posted February 5, 2007 Is there anyway to get a handle to the GUI which is current/active/switched to? Like the return value from GUISwitch. If you pass GUISwitch a valid GUI handle, it returns the handle to the GUI that was previously "active". I tried just passing a bogus handle to GUISwitch, something like: Func GUIGetCurrent() $hCurrent = GUISwitch(WinGetHandle('')) GUISwitch($hCurrent) Return $hCurrent EndFunc But that didn't work. Any ideas? Or is this not possible? My AutoIt Stuff | My Github
cjconstantine Posted February 6, 2007 Posted February 6, 2007 Is there anyway to get a handle to the GUI which is current/active/switched to? Like the return value from GUISwitch. If you pass GUISwitch a valid GUI handle, it returns the handle to the GUI that was previously "active". I tried just passing a bogus handle to GUISwitch, something like: Func GUIGetCurrent() $hCurrent = GUISwitch(WinGetHandle('')) GUISwitch($hCurrent) Return $hCurrent EndFuncoÝ÷ ضv'gßÛp¢¹(y«®+-+'¢Úh²Èïêº^Ziº.¶Øb±«¢+ØÀÌØí¡ ÕÉɹÐô]¥¹Ñ!¹±¡]¥¹ÑQ¥Ñ± ÌäìÌäì¤
quaizywabbit Posted February 6, 2007 Posted February 6, 2007 (edited) Opt("WinTitleMatchMode", 4)WinGetHandle( "active")"active" matches the currently active window (same as "" in the default WinTitleMatchMode). Edited February 6, 2007 by quaizywabbit [u]Do more with pre-existing apps![/u]ANYGUIv2.8
therks Posted February 7, 2007 Author Posted February 7, 2007 I think I may have misrepresented what I want... I don't want the active (ie: currently in use) window (which is what both your replies will net me). I want the "current" GUI window. ie: The handle to the GUI that would receive the next control. It's not urgent, nor even important at the moment, I was just wondering if it was possible. Thanks anyway. My AutoIt Stuff | My Github
Moderators SmOke_N Posted February 7, 2007 Moderators Posted February 7, 2007 I think I may have misrepresented what I want...I don't want the active (ie: currently in use) window (which is what both your replies will net me). I want the "current" GUI window. ie: The handle to the GUI that would receive the next control. It's not urgent, nor even important at the moment, I was just wondering if it was possible.Thanks anyway.Have you looked at IsChild / GetParent APIs maybe? 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.
therks Posted February 12, 2007 Author Posted February 12, 2007 No I have not (yet). Sorry for the (very delayed) reply. That is a good idea, you've got me thinking now... Something like this (pseudo code): Func GetCurrent $dummy = GuiCtrlCreateDummy $parent = DllCall(... GetParent of $dummy) GuiCtrlDelete($dummy) return $parent EndFunc Thanks for the idea Smoke! My AutoIt Stuff | My Github
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