I'm trying to create a toggle that minimizes a program to task tray if its window is open, but opens its window if it's currently on task tray:
Code: Select all
#o::
{
DetectHiddenWindows(true)
if WinActive("VueMinder Pro")
{
WinMinimize("VueMinder Pro")
Return
}
Else
{
if WinExist("VueMinder Pro")
{
winid := WinGetID("VueMinder Pro")
DllCall("SwitchToThisWindow", "UInt", winid, "UInt", 1)
Return
}
if !WinExist("VueMinder Pro")
{
Run("`"C:\Program Files (x86)\VueSoft\VueMinder\VueMinder.exe`"")
ErrorLevel := WinWait("VueMinder Pro", , 4) , ErrorLevel := ErrorLevel = 0 ? 1 : 0
WinActivate("VueMinder Pro")
Return
}
}
Return
}
Thanks in advance!