Suirad Posted September 19, 2009 Posted September 19, 2009 my script currently has 2(+) gui windows. the problem is, if i close one (the windows X) then guigetmsg() returns the same $gui_event_close no matter which window it came from. Is there a way to accurately return the correct window that was exited? (trying to avoid using something like wingetactive() to find it)
Hawkwing Posted September 19, 2009 Posted September 19, 2009 (edited) Try this maybe? GuiSetOnEvent($GUI_EVENT_CLOSE, "close", $winhandle) Edited September 19, 2009 by Hawkwing The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.
Suirad Posted September 19, 2009 Author Posted September 19, 2009 Try this maybe? GuiSetOnEvent($GUI_EVENT_CLOSE, "close", $winhandle) ah, that looks good. do you think a possible guiregistermsg() would be able to equivalent to the code above? i dont use guioneventmode
picaxe Posted September 19, 2009 Posted September 19, 2009 Try#include <GuiConstants.au3> $iGuiCenter = @DesktopWidth / 2 $hGui1 = GUICreate("1", 150, 100, $iGuiCenter -250) GUISetState() $hGui2 = GUICreate("2", 150, 100, $iGuiCenter -80) GUISetState() $hGui3 = GUICreate("3", 150, 100, $iGuiCenter +90) GUISetState() $iWindows = 3 While 1 $Msg = GUIGetMsg(1) Select Case $Msg[0] = $GUI_EVENT_CLOSE Switch $Msg[1] Case $hGui1 GUIDelete($hGui1) $iWindows -= 1 Case $hGui2 GUIDelete($hGui2) $iWindows -= 1 Case $hGui3 GUIDelete($hGui3) $iWindows -= 1 EndSwitch If Not $iWindows Then Exit EndSelect WEnd
Suirad Posted September 19, 2009 Author Posted September 19, 2009 thanks a ton picaxe i knew there was something i was missing
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