Code:#NoTrayIcon #SingleInstance force OnMessage(0x218, "WM_POWERBROADCAST") WM_POWERBROADCAST(wParam, lParam) { If wParam=0 { Process, Exist, MediaPortal.exe If ( errorlevel > 0 ) ; Process, Close, MediaPortal.exe Send, !{F4} Else Run, "C:\Programme\Team MediaPortal\RC.exe" Return 0x424D5144 } Else Return }
Unfortunately, my PC still goes to sleep when I press the power button on the Gyration remote, even after implementing the above AutoHotKey script. My OS is Win XP Pro (not MCE, not Vista) -- not sure if this makes any difference in the behavior of the power button.