1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
#NoEnv SendMode Input SetWorkingDir %A_ScriptDir% DllCall("kernel32.dll\SetProcessShutdownParameters", UInt, 0x4FF, UInt, 0) #SingleInstance ignore
menu,tray,icon,App\AppInfo\appicon.ico
SetTitleMatchMode, 2
Run, AirExplorerPortable.exe
WinWait, ahk_exe AirExplorer.exe
WinHide, ahk_exe Thunderbird.exe
OnExit, ExitSub
OnMessage(0x404, "AHK_NOTIFYICON")
OnMessage(0x11, "WM_QUERYENDSESSION")
AHK_NOTIFYICON(wParam, lParam) { if (lParam = 0x202) { WinShow, Air Explorer WinActivate, Air Explorer } }
WM_QUERYENDSESSION(wParam, lParam) { ENDSESSION_LOGOFF = 0x80000000 Process,Close,AirExplorer.exe Process,WaitClose,AirExplorerPortable.exe }
ProcessExist(Name){ Process,Exist,%Name% return Errorlevel }
Loop { If !ProcessExist("AirExplorer.exe") { ExitApp } WinGet, winState, MinMax, ahk_exe AirExplorer.exe if (winState = -1) { WinHide, Air Explorer } sleep 500 }
ExitSub: WinClose, ahk_exe AirExplorer.exe Process,close,AirExplorer.exe ExitApp
|