AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Detecting how window was closed.

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
valenfor



Joined: 26 Feb 2005
Posts: 20

PostPosted: Tue May 31, 2005 1:55 pm    Post subject: Detecting how window was closed. Reply with quote

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
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Tue May 31, 2005 3:21 pm    Post subject: Reply with quote

Currently AutoHotkey is unable to detect events such as closing a window, so this wouldn't be possible.
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Wed Jun 01, 2005 5:37 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Wed Jun 01, 2005 8:24 pm    Post subject: Re: Detecting how window was closed. Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group