What do you do if you accidentally bump the power button on windows and everything is about to shut down? I’ll tell you what I do, alt + f2. My program sits in the background and works on 9x – win7.
#include <windows.h> #DEFINE ID 89023 int main(void) { HWND deskwin = GetDesktopWindow(); RegisterHotKey(deskwin,ID, 0x0008,0x66); MSG msg = {0}; while (GetMessage(&msg, NULL, 0, 0) != 0) { if (msg.message == WM_HOTKEY) { AbortSystemShutdown(NULL); } } return 0; }
Wow, well that’s a new thing i’ve learned today.
Full source codes possible?
That is the full source. All of a dozen or so lines.