; Make sure that specific processes can't be successfully started. ;#SingleInstance,Ignore ; TODO: final version needs to have this turned on instead #SingleInstance,Force #Persistent ;#NoTrayIcon OnExit,NOTHING Menu,Tray,DeleteAll Menu,Tray,NoStandard Menu,Tray,NoDefault Loop { CloseProc("FireFox.exe") CloseProc("IExplore.exe") CloseProc("Opera.exe") Sleep,0 } NOTHING: Return CloseProc(image) { Process,Exist,%image% if (ErrorLevel != 0) { pid := ErrorLevel ;MsgBox,found process %pid% DetectHiddenWindows,off hwnd := WinExist("ahk_pid " . pid) if (hwnd != 0) { WinClose,ahk_id %hwnd%,,1 ;WinWaitClose,ahk_id %hwnd%,,2 IfWinExist,ahk_id %hwnd% { MsgBox,Unable to kill window %hwnd% } else { MsgBox,,ProcessBlacklist.ahk,%image% is currently disabled.,2 } ;WinClose,ahk_id %hwnd% } ;else ;MsgBox,Unable to find window for %pid% ;DetectHiddenWindows,Off } }