 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
drmartell
Joined: 23 Feb 2008 Posts: 27
|
Posted: Sun Mar 08, 2009 8:48 pm Post subject: Resize one window based on MinMax state of another |
|
|
I have a multimonitor setup for stock trading. On one of my monitors I like to view my charts (one window) and my order entry software (separate window).
When my order entry window is minimized, my charts can be maximized to take up the whole monitor. When I Restore my order entry window, I want the charts window to automatically resize to accommodate the second window.
I don't have much experience coding, but enough to know that what I have so far is not an elegant solution. I probably need to be looking at shell hooks or something.
My immediate question is, why does the first half of the If-else statement never get executed even though I can see from the MsgBox that the condition is true? Also, note that I am using a clumsy workaround because winrestore didn't seem to work on this window.
| Code: |
; see here for minmax info: http://www.autohotkey.com/forum/topic40430.html&highlight=test?sid=73233bc5250e6736b6374e8972ff0d70
Title = TradeStation 8.4 - Lower Left - UncleMikes
Loop
{
WinGet, mmState, MinMax, ES 03-09
MsgBox, MinMax is %mmState%
IFEqual, mmState,0,
{
WinWait, %Title%,
IfWinNotActive, %Title%, , WinActivate, %Title%,
WinWaitActive, %Title%,
SendInput, !{SPACE}
Sleep, 500
SendInput, R
;WinRestore, %Title%
}
else
{
WinWait, %Title%,
IfWinNotActive, %Title%, , WinActivate, %Title%,
WinWaitActive, %Title%,
WinMaximize, %Title%
}
Sleep, 3000
}
|
|
|
| Back to top |
|
 |
Montu
Joined: 11 Feb 2009 Posts: 142 Location: India
|
Posted: Mon Mar 09, 2009 1:01 pm Post subject: |
|
|
| Code: | | IFEqual, mmState,0, |
remove the coma and see if it helps?
also use bracket here and see if that works?
| Code: |
IFEqual, mmState,0,
{
WinWait, %Title%,
IfWinNotActive, %Title%
{
WinActivate, %Title%,
SendInput, !{SPACE}
Sleep, 500
SendInput, R
;WinRestore, %Title%
}
} |
|
|
| Back to top |
|
 |
drmartell
Joined: 23 Feb 2008 Posts: 27
|
Posted: Mon Mar 09, 2009 1:47 pm Post subject: |
|
|
Thank you Montu, those suggestions worked.  |
|
| 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
|