AutoHotkey Community

It is currently May 27th, 2012, 12:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: November 18th, 2009, 11:01 am 
Offline

Joined: May 31st, 2007, 5:26 am
Posts: 23
When I refer to "Focus", I am mean the Active Window (I'm not sure of the proper terminology).

When this code runs, the Focus goes to somewhere other than "The DownLoader".

When complete, I want the Focus to be on "The DownLoader".

Can someone explain how this is done?

Code:
#M::
IfWinExist MetaStock Professional
{
MsgBox,0,,MetaStock is Running
   IfWinExist The DownLoader
   {
   MsgBox,0,,The DownLoader is running
   } 
   else
   {
   Run C:\Program Files\Equis\The DownLoader\Dlwin.exe, C:\Program Files\Equis\The DownLoader\
   Return
   }
}
else
{
   Run C:\Program Files\Equis\MetaStock\Mswin.exe,,max
   WinWaitActive MetaStock Professional,,5
   Run C:\Program Files\Equis\The DownLoader\Dlwin.exe, C:\Program Files\Equis\The DownLoader\
   WinWaitActive The DownLoader,,50
; MsgBox,0,,Activating the Downloader
   WinActivate The DownLoader
   Return
}


[ Moderator!: Applied [Code] tags ]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 11:47 am 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
Code:
#M::
  IfWinExist, MetaStock Professional
  {
    MsgBox,0,,MetaStock is Running,1

    IfWinExist The DownLoader
      MsgBox,0,,The DownLoader is running,1
    Else
    {
      Run C:\Program Files\Equis\The DownLoader\Dlwin.exe, C:\Program Files\Equis\The DownLoader\
      WinWait, The DownLoader
    }
  }
  Else
  {
    Run C:\Program Files\Equis\MetaStock\Mswin.exe,,max
    WinWaitActive, MetaStock Professional

    Run C:\Program Files\Equis\The DownLoader\Dlwin.exe, C:\Program Files\Equis\The DownLoader\
    WinWait, The DownLoader
  }
  WinActivate, The DownLoader
  WinWaitActive, The DownLoader
  MsgBox,0,,The Downloader is now Active!,1
Return


Make sure it works first, and then if need be i'll (or someone) will explain it

Ps: Use [code]<your code here>[/(slash)code] to put code in scrolling window


Last edited by a_h_k on November 19th, 2009, 1:20 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 2:07 pm 
Offline

Joined: May 31st, 2007, 5:26 am
Posts: 23
The term WinWaitExist produces a syntax error.

One more point of interest here...The DownLoader Window is not active with my original code, but the DownLoader "item" in the Taskbar is active. When I move my mouse over the "item" in the Taskbar, The DownLoader Window becomes active. Strange...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 1:18 pm 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
iamnu wrote:
The term WinWaitExist produces a syntax error

Sorry, that should be just "WinWait" (i have made the correction)

iamnu wrote:
The DownLoader Window is not active with my original code, but the DownLoader "item" in the Taskbar is active. When I move my mouse over the "item" in the Taskbar, The DownLoader Window becomes active

You mean it's loaded as "minimized" to the taskbar? (ie "becomes" just a "button")?
When move (not click?) mouse over the button, does it then pop-up as a window?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 1:44 pm 
Offline

Joined: May 31st, 2007, 5:26 am
Posts: 23
Oh, thank you! It works fine now, just like I wanted.

FYI, I had to change two lines of code back to the original way I had them, as follows:

Run C:\Program Files\Equis\MetaStock\Mswin.exe,,max
WinWaitActive MetaStock Professional,,5
Run C:\Program Files\Equis\The DownLoader\Dlwin.exe, C:\Program Files\Equis\The DownLoader\
WinWaitActive The DownLoader,,50

Without the 5 and 50 at the end of the second and fourth line, "The DownLoader" didn't get executed.

Thanks again for your help...


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: chaosad, Exabot [Bot], Google Feedfetcher, jrav, Yahoo [Bot] and 22 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