 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
HuBa
Joined: 24 Feb 2007 Posts: 172 Location: Budapest, Hungary
|
Posted: Mon Mar 17, 2008 10:42 pm Post subject: [SOLVED] Restore WLM chatwindow from minimized state |
|
|
It should be an easy job on every window, but Windows Live Messenger's chatwindow is not an "average" window.
Minimizing works fine, but it seems it is immune to the WinRestore command while minimized.
| Code: | #IfWinExist ahk_class IMWindowClass
^+B::
WinGet ch_Minimized, MinMax, ahk_class IMWindowClass
if ch_Minimized = -1
{
PostMessage 0x112, 0xF120,,, ahk_class IMWindowClass ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE
;WinRestore ahk_class IMWindowClass
}
else
{
PostMessage 0x112, 0xF020,,, ahk_class IMWindowClass ; 0x112 = WM_SYSCOMMAND, 0xF020 = SC_MINIMIZE
;WinMinimize ahk_class IMWindowClass
}
Return
#IfWinExist |
First thing is what I noticed, that the value of ch_Minimized is always 0, never -1.
Check it with MsgBox %ch_Minimized%
Now how can I restore this window if it is minimized?
Last edited by HuBa on Tue Mar 18, 2008 6:47 pm; edited 1 time in total |
|
| Back to top |
|
 |
System Monitor
Joined: 09 Mar 2007 Posts: 401 Location: Unknown
|
Posted: Mon Mar 17, 2008 10:51 pm Post subject: |
|
|
Maybe Winset, Top then Winactivate  _________________
 |
|
| Back to top |
|
 |
HuBa
Joined: 24 Feb 2007 Posts: 172 Location: Budapest, Hungary
|
Posted: Tue Mar 18, 2008 6:47 pm Post subject: |
|
|
WinSet, Top doesn't do anything, but WinActivate do the trick. Thank you!
Now the final remaining problem is to detect the state of the window to allow toggling. Unfortunately WinGet MinMax always returns 0.
But I think it is not important anyway, since checking for IfWinActive is better.
Now here is the solution:
| Code: | #IfWinExist ahk_class IMWindowClass
^+B::
IfWinActive ahk_class IMWindowClass
PostMessage 0x112, 0xF020 ; 0x112 = WM_SYSCOMMAND, 0xF020 = SC_MINIMIZE
else
WinActivate ahk_class IMWindowClass
Return
#IfWinExist |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|