X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fd3dretrace_ws.cpp;h=42bd0abef159cd068a00d7cacbbee42050060b65;hb=6bb028d7223347f167c2a4e16f8bb0028c95ffe9;hp=b8c29e85078bc69d1eb620eb2653fc85231f4ef5;hpb=0dd1f3df5feda7284cb9610f78583ff80fdaef0e;p=apitrace diff --git a/retrace/d3dretrace_ws.cpp b/retrace/d3dretrace_ws.cpp index b8c29e8..42bd0ab 100644 --- a/retrace/d3dretrace_ws.cpp +++ b/retrace/d3dretrace_ws.cpp @@ -37,6 +37,13 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { MINMAXINFO *pMMI; switch (uMsg) { + case WM_KEYDOWN: + switch (wParam) { + case VK_ESCAPE: + PostMessage(hWnd, WM_CLOSE, 0, 0); + break; + } + break; case WM_GETMINMAXINFO: // Allow to create a window bigger than the desktop pMMI = (MINMAXINFO *)lParam; @@ -45,6 +52,9 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) pMMI->ptMaxTrackSize.x = 60000; pMMI->ptMaxTrackSize.y = 60000; break; + case WM_CLOSE: + exit(0); + break; default: break; } @@ -121,5 +131,21 @@ resizeWindow(HWND hWnd, int width, int height) { } +bool +processEvents(void) { + MSG uMsg; + while (PeekMessage(&uMsg, NULL, 0, 0, PM_REMOVE)) { + if (uMsg.message == WM_QUIT) { + return false; + } + + if (!TranslateAccelerator(uMsg.hwnd, NULL, &uMsg)) { + TranslateMessage(&uMsg); + DispatchMessage(&uMsg); + } + } + return true; +} + } /* namespace d3dretrace */