06-19-2021, 04:25 PM
Hello, I'm new with QM and I will really appreciate a help for converting my Autohotkey macro to QM.
My goal is to do CTRL-S and if TC Windows is not active, show it, if TC Windows is active, hide to tray, in this way I can activate or hide TC pressing CTRL-S
Here is my Autohotkey script
PATH_COMMANDER := "C:\totalcmd\TOTALCMD64.EXE"
;--TOTALCOMMANDER
^!s::
Winget, NewPID, ID, ahk_class TTOTAL_CMD
F_HIDE_SHOW("TTOTAL_CMD",PATH_COMMANDER,"Total Commander","TTOTAL_CMD")
return
F_HIDE_SHOW(PRG,PATH,NAME,TRAY)
{
DetectHiddenWindows, On
Winget, WinID, PID, ahk_class %PRG%
DetectHiddenWindows, Off
if (WinID <> "")
{
{
If WinActive("ahk_class " . PRG) <> 0
{
WinGetTitle, TheWinTitle, ahk_class %PRG%
menu, tray, Tip, %NAME%
menu, tray, add, %NAME%, %TRAY%
WinHide, ahk_class %PRG%
return
}
else
{
menu, tray, UseErrorLevel
menu, tray, Delete, %NAME%
WinShow, ahk_class %PRG%
WinActivate, ahk_class %PRG%
}
}
}
else
{
Run %PATH%
WinActivate, ahk_class %PRG%
}
}
Thanks in advance!
My goal is to do CTRL-S and if TC Windows is not active, show it, if TC Windows is active, hide to tray, in this way I can activate or hide TC pressing CTRL-S
Here is my Autohotkey script
PATH_COMMANDER := "C:\totalcmd\TOTALCMD64.EXE"
;--TOTALCOMMANDER
^!s::
Winget, NewPID, ID, ahk_class TTOTAL_CMD
F_HIDE_SHOW("TTOTAL_CMD",PATH_COMMANDER,"Total Commander","TTOTAL_CMD")
return
F_HIDE_SHOW(PRG,PATH,NAME,TRAY)
{
DetectHiddenWindows, On
Winget, WinID, PID, ahk_class %PRG%
DetectHiddenWindows, Off
if (WinID <> "")
{
{
If WinActive("ahk_class " . PRG) <> 0
{
WinGetTitle, TheWinTitle, ahk_class %PRG%
menu, tray, Tip, %NAME%
menu, tray, add, %NAME%, %TRAY%
WinHide, ahk_class %PRG%
return
}
else
{
menu, tray, UseErrorLevel
menu, tray, Delete, %NAME%
WinShow, ahk_class %PRG%
WinActivate, ahk_class %PRG%
}
}
}
else
{
Run %PATH%
WinActivate, ahk_class %PRG%
}
}
Thanks in advance!