AutoHotkey Community

It is currently May 26th, 2012, 3:21 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: March 8th, 2009, 9:48 pm 
Offline

Joined: February 23rd, 2008, 6:52 pm
Posts: 30
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
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2009, 2:01 pm 
Offline

Joined: February 11th, 2009, 2:23 pm
Posts: 142
Location: India
Code:
IFEqual, mmState,0,


remove the coma and see if it helps?

Code:
IFEqual, mmState,0


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%
}
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2009, 2:47 pm 
Offline

Joined: February 23rd, 2008, 6:52 pm
Posts: 30
Thank you Montu, those suggestions worked. :D


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, nyoe, patgenn123, Yahoo [Bot] and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group