#F1::
RAMP("C:\Program Files\Everything\Everything.exe")
;~ RAMP("D:\ChromePlus\Google Chrome\chrome.exe")
;~ RAMP("notepad")
return
;RunOrActivateOrMinimizeProgram
RAMP(ExePath) {
tExe:=GetFilename(ExePath)
if (SubStr(tExe,-3)!=".exe")
tExe.=".exe"
if WinExist("ahk_exe" . tExe)
{
If WinActive("ahk_exe" . tExe) ; "ahk_exe" 后不需要空格.
{
WinMinimize
}
else
{
WinActivate
}
}else{
Run *RunAs "%ExePath%"
}
return
}
GetFilename(txt)
{
SplitPath, txt, o
return o
}
[FUNC]RunOrActivateOrMinimizeProgram
最新推荐文章于 2023-06-15 19:32:11 发布