 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
iamnu
Joined: 31 May 2007 Posts: 23
|
Posted: Wed Nov 18, 2009 10:01 am Post subject: Help with Code...Focus in the wrong place |
|
|
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 ] |
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 344
|
Posted: Wed Nov 18, 2009 10:47 am Post subject: |
|
|
| 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 Thu Nov 19, 2009 12:20 pm; edited 1 time in total |
|
| Back to top |
|
 |
iamnu
Joined: 31 May 2007 Posts: 23
|
Posted: Wed Nov 18, 2009 1:07 pm Post subject: |
|
|
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... |
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 344
|
Posted: Thu Nov 19, 2009 12:18 pm Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
iamnu
Joined: 31 May 2007 Posts: 23
|
Posted: Thu Nov 19, 2009 12:44 pm Post subject: |
|
|
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... |
|
| 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
|