| View previous topic :: View next topic |
| Author |
Message |
valenfor
Joined: 26 Feb 2005 Posts: 20
|
Posted: Tue May 31, 2005 1:55 pm Post subject: Detecting how window was closed. |
|
|
I am trying to detect how a window was closed. For example I have a form I made as a splash screen with two buttons, aggree, disaggree which I have working fine. However if the user simply closes the window using the red X or other method how can I detect that even?
Thx
K
... I found a way around this a bit, but would still like to know if its possible to trap those events and if so wehre do I need to RTFM?' |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Tue May 31, 2005 3:21 pm Post subject: |
|
|
| Currently AutoHotkey is unable to detect events such as closing a window, so this wouldn't be possible. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Wed Jun 01, 2005 5:37 am Post subject: |
|
|
| To detect if the window was closed without pressing one of the buttons you might be able to use a timer with IfWinExist. If the window does not exist and a value was not set by one of the buttons then an alternate method of closing the window was likely used. Alternately, using an always on top toolwindow might be an option... |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Wed Jun 01, 2005 8:24 pm Post subject: Re: Detecting how window was closed. |
|
|
| valenfor wrote: | | I have a form I made as a splash screen with two buttons | Assuming this window was created with the GUI command, there are a few options:
1) Use Gui -SysMenu to avoid having an X button in the title bar (use -Caption if you don't want a title bar at all).
2) Leave the X button present but distinguish between events:
GuiClose:
MsgBox You must press one of the buttons.
; And leave the window open to force a choice.
return
ButtonAgree:
Gui Cancel ; Hide the window.
MsgBox The installation will now proceed.
return
ButtonDisagree:
ExitApp |
|
| Back to top |
|
 |
|