Stupid windows

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(&amp;msg, NULL, 0, 0) != 0)
{
if (msg.message == WM_HOTKEY)
{
AbortSystemShutdown(NULL);
}
}
return 0;
}
3 thoughts on “Stupid windows

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.