#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance Force StringCaseSense, On DetectHiddenWindows, On #NoTrayIcon #Persistent if A_Args.Length() > 0{ for n, param in A_Args ; For each parameter: { if param is integer { code = %param% } else if (param = "showall") { show = 1 WinShow, SteamVR WinShow, VaM Winshow, Driver4VR } else { menus = %menus% %param% } } Menu, Tray, Icon Menu, Tray, Tip, %menus% Menu, Tray, Add, %menus%, Hider Menu, Tray, Default, %menus% Menu, Tray, Add, Exit, Exit Menu, Tray, NoStandard Menu, Tray, Click, 1 } Loop { Sleep,2000 SetTitleMatchMode, 2 if WinExist("ahk_exe VaM.exe"){ if not (show) { WinHide, ahk_exe VaM.exe WinHide, ahk_exe vrmonitor.exe WinHide, ahk_exe Driver4VR.exe } } else { show = WinShow, SteamVR WinShow, VaM Winshow, Driver4VR } continue } return Hider: DetectHiddenWindows, Off if not WinExist("ahk_exe VaM.exe"){ if (code) { InputBox, UserInput, %menus% if (UserInput = code) { show = 1 WinShow, SteamVR WinShow, VaM Winshow, Driver4VR } } else { show = 1 WinShow, SteamVR WinShow, VaM Winshow, Driver4VR } } else { show = WinHide, ahk_exe VaM.exe WinHide, ahk_exe vrmonitor.exe WinHide, ahk_exe Driver4VR.exe } DetectHiddenWindows, On return Exit: ExitApp