From e019401407d96f8bd7a6a76c57b6a73c9735997c Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Sun, 21 Nov 2010 17:11:47 +0200 Subject: [PATCH] Use ^S instead for screenshots, VK_SNAPSHOT is not sent to WindowProc --- main.c | 10 ++++++++-- main.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 1733615..c0a4a24 100644 --- a/main.c +++ b/main.c @@ -302,9 +302,12 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } } #ifdef HAVE_LIBPNG - else if(wParam == VK_SNAPSHOT) + if(wParam == VK_CONTROL || wParam == 0x53 /* S */) { - screenshot(ddraw->primary); + if(GetAsyncKeyState(VK_CONTROL) & 0x8000 && GetAsyncKeyState(0x53) & 0x8000) + { + screenshot(ddraw->primary); + } } #endif break; @@ -360,6 +363,9 @@ HRESULT __stdcall ddraw_SetCooperativeLevel(IDirectDrawImpl *This, HWND hWnd, DW SetPixelFormat( This->render.hDC, ChoosePixelFormat( This->render.hDC, &pfd ), &pfd ); } + GetWindowText(This->hWnd, (LPTSTR)&This->title, sizeof(This->title)); + printf("wintitle: %s\n", This->title); + return DD_OK; } diff --git a/main.h b/main.h index 39f86dd..28e7396 100644 --- a/main.h +++ b/main.h @@ -41,6 +41,7 @@ typedef struct IDirectDrawImpl BOOL windowed_init; DEVMODE mode; struct IDirectDrawSurfaceImpl *primary; + char title[128]; /* real export from system32\ddraw.dll */ HRESULT WINAPI (*DirectDrawCreate)(GUID FAR*, LPDIRECTDRAW FAR*, IUnknown FAR*);