flyingboz Posted August 2, 2004 Posted August 2, 2004 My first GUI is working beautifully - thanks to all who have participated in making this functionality available. How do I detect a mouseclick closing the GUI on the titlebar ? if someone clicks the X to kill the entire window, the GUI obediently goes away, but my script does not stop running. What should I be testing for to make the script die, too? Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.
Josbe Posted August 2, 2004 Posted August 2, 2004 First, I recommend you, use AutoBuilderRead more about: GUIMsg function and example. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
flyingboz Posted August 2, 2004 Author Posted August 2, 2004 Thanks for the insight ... Have it working now. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.
Valik Posted August 2, 2004 Posted August 2, 2004 I would recommend using Opt("WinTitleMatchMode", 4). Then create a global variable to store the HWND of the GUI. GuiCreate() returns the HWND, so do something like: $g_hWnd = "handle=" & CreateGui() Then use a While loop like: While WinExists($g_hWnd) Local $msg = GuiMsg(0) If $msg = -3 Then GuiDelete(); This will cause the loop to end EndIf WEnd
flyingboz Posted August 2, 2004 Author Posted August 2, 2004 Valik, Thanks for the input - that helps too. I already had the loop going on - I just missed checking for the possibility of negative return values from the guimsg() command - I see how using the hwnd would be very useful for more complex (multiple/interacting) GUIs. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.
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