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 

WinClose on script windows

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Thu Feb 03, 2005 2:42 am    Post subject: WinClose on script windows Reply with quote

I recently noticed that when WinClose is used on a script's main window, it closes the script itself. This is probably by design, so the reason I post this in Wish List is that I think it'd be nice if this were changed, so that the main window is simply hidden and the script stays running.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Thu Feb 03, 2005 1:06 pm    Post subject: Reply with quote

A lot of scripts probably depend on the current behavior (there are even some examples posted in the forum). So it's probably best not to change it.

You can work around this by checking the title or class of the target window and sending it a WinMinimize instead. Or you can send !{F4}, which closes some apps but hides others if they are designed that way. I think you could even avoid the keystrokes with the following, which I've added to the help file:

WinClose sends a WM_CLOSE message to the target window, which is a somewhat forceful method of closing it. An alternate method of closing is to send the following message. It might produce different behavior because it is similar in effect to pressing Alt-F4 or clicking the window's close button in its title bar:
PostMessage, 0x112, 0xF060,,, WinTitle, WinText ; 0x112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE
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 -> Wish List 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