diff --git a/windows-snapshot-tool/bin/freeze.exe b/windows-snapshot-tool/bin/freeze.exe index 51cd4f1..9d54705 100755 Binary files a/windows-snapshot-tool/bin/freeze.exe and b/windows-snapshot-tool/bin/freeze.exe differ diff --git a/windows-snapshot-tool/src/main.cpp b/windows-snapshot-tool/src/main.cpp index 77318c9..bfd17fb 100644 --- a/windows-snapshot-tool/src/main.cpp +++ b/windows-snapshot-tool/src/main.cpp @@ -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;