|
|
@ -85,9 +85,16 @@ int WINAPI WinMain (HINSTANCE hThisInstance, |
|
|
|
/* Make the window visible on the screen */ |
|
|
|
ShowWindow (Hwnd, nCmdShow); |
|
|
|
|
|
|
|
minimize(); |
|
|
|
|
|
|
|
/* Run the message loop. It will run until GetMessage() returns 0 */ |
|
|
|
while (GetMessage (&messages, NULL, 0, 0)) |
|
|
|
{ |
|
|
|
if (messages.message == WM_HOTKEY) |
|
|
|
{ |
|
|
|
doScreenshot(); |
|
|
|
} |
|
|
|
|
|
|
|
/* Translate virtual-key messages into character messages */ |
|
|
|
TranslateMessage(&messages); |
|
|
|
/* Send message to WindowProcedure */ |
|
|
@ -213,6 +220,9 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM |
|
|
|
|
|
|
|
case WM_DESTROY: |
|
|
|
|
|
|
|
// quit the application.
|
|
|
|
Shell_NotifyIcon(NIM_DELETE, ¬ifyIconData); |
|
|
|
UnregisterHotKey(Hwnd, WM_HOTKEY_FREEZE); |
|
|
|
PostQuitMessage (0); |
|
|
|
break; |
|
|
|
|
|
|
|