close AutoHotkey's main window programmatically Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

close AutoHotkey's main window programmatically  Topic is solved

19 Aug 2018, 17:11

- AutoHotkey's main window is the one you get by right-clicking the tray icon and clicking Open.
- This closes the process rather than the window.
WinClose, A
- This closes the window.
ControlSend,, {Esc}, A
- I wondered if there was a cleaner way to close the window. Thanks.

- [EDIT:] This works to close the window (without closing the process).
PostMessage, 0x112, 0xF060,,, A ;WM_SYSCOMMAND := 0x112 ;SC_CLOSE := 0xF060
- It is mentioned on the WinClose documentation page.
- While WinRestore/WinMove/WinMinimize/WinMaximize appear to work similarly to the items in a window's alt+space menu. WinClose is an exception.

- In order of forcefulness: WM_SYSCOMMAND+SC_CLOSE, WM_CLOSE, TerminateProcess.
- WinClose uses WM_CLOSE. WinKill uses WM_CLOSE and TerminateProcess.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: downstairs, Google [Bot], OrangeCat and 182 guests