AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Winactivate only works once without reloading script

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Wolfer



Joined: 08 Nov 2005
Posts: 14
Location: Chicago, IL

PostPosted: Wed Jan 16, 2008 2:06 am    Post subject: Winactivate only works once without reloading script Reply with quote

I am new to AHK and have been trying to get WinActivate to work for an explorer replacement called PowerDesk. The program has not been upgraded for Vista (this may be part of the problem) and has some funky behaviors:

1. It sometimes disappears from the Taskbar, but is apparently still running in the background. If I try to start it, I get nothing. If I open Task Manager and find two copies running and end one, PowerDesk suddenly appears. I thought a WinActivate script from AHK would solve the problem, i.e. it would find PowerDesk if it was running hidden in the background, and activate it. Except...

2. I can only get WinActivate to work one time if the window is minimized. After that the WinActivate script stops working to maximize the window unless I reload the script. If PowerDesk is not running, then the Run command always works, no matter how many times I close PowerDesk and run the AHK script. Here is the script:

^!p::
SetTitleMatchMode, RegEx
SetTitleMatchMode, Fast
{
IfWinExist ahk_class EXPLORERPLUS
WinActivate ahk_class EXPLORERPLUS
else
Run C:\Program Files\VCOM\PowerDesk\PDExplo.exe
}
return

^!m::
IfWinExist ahk_class metapad
WinActivate
else
Run C:\Program Files\metapad\metapad.exe
return

I threw in the metapad script, because the script for metapad works perfectly every time no matter how many times I minimize metapad, and it's configured exactly the same way as the PowerDesk script. Any suggestions? Toss PowerDesk or live with the glitch?

------------------------------
One more note: WinMaximize works fine (?!?!)
The script below works every time, no need to reload.

^!p::
SetTitleMatchMode, RegEx
{
IfWinExist, ahk_class EXPLORERPLUS
WinMaximize, ahk_class EXPLORERPLUS

else
Run C:\Program Files\VCOM\PowerDesk\PDExplo.exe
}
return
Back to top
View user's profile Send private message
BoBoĻ
Guest





PostPosted: Wed Jan 16, 2008 2:58 am    Post subject: Reply with quote

What about WinRestore instead of WinMaximize and DetectHiddenWindows,On?
Back to top
Wolfer



Joined: 08 Nov 2005
Posts: 14
Location: Chicago, IL

PostPosted: Wed Jan 16, 2008 6:40 am    Post subject: Tried your suggestions... Reply with quote

I tried every permutation, and included DetectHiddenWindows,On.

At odd times, which I cannot figure out why, the program hides from the Taskbar, and only appears as a running process when the Task Manager is invoked. In that state, it ignores IfWinExist, WinRestore, WinMaximize. It even ignores Run, c:/...PowerDesk.

As long as the program window can be seen in the Taskbar, WinMaximize brings it back.

One of the options is to "Minimize to System Tray." Once the icon is in the System Tray, again, none of these commands make it return to a full window.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group