From 557ee68e47dbc5f308d730356d8e70b9ade6d510 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 7 Jun 2015 22:06:41 -0400 Subject: [PATCH] Overdue change: handled WM_PRINTCLIENT in uiWindow. --- redo/windows/tabpage.c | 2 ++ redo/windows/window.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/redo/windows/tabpage.c b/redo/windows/tabpage.c index 72b7c5d4..47f8ed11 100644 --- a/redo/windows/tabpage.c +++ b/redo/windows/tabpage.c @@ -91,6 +91,8 @@ static INT_PTR CALLBACK dlgproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar // unthemed dialogs don't respond to WM_PRINTCLIENT // fortunately they don't have any special painting if (uMsg == WM_PRINTCLIENT) { + // don't worry about the return value; hopefully DefWindowProcW() caught it (if not the dialog procedure itself) + // we COULD paint the dialog background brush ourselves but meh, it works SendMessageW(hwnd, WM_ERASEBKGND, wParam, lParam); // and pretend we did nothing just so the themed dialog can still paint its content return FALSE; diff --git a/redo/windows/window.c b/redo/windows/window.c index 02829dd6..b35dcd04 100644 --- a/redo/windows/window.c +++ b/redo/windows/window.c @@ -50,6 +50,11 @@ static LRESULT CALLBACK windowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA if (w->child != NULL) uiControlQueueResize(uiControl(w)); return 0; + case WM_PRINTCLIENT: + // we do no special painting; just erase the background + // don't worry about the return value; we let DefWindowProcW() handle this message + SendMessageW(hwnd, WM_ERASEBKGND, wParam, lParam); + return 0; case WM_CLOSE: if ((*(w->onClosing))(uiWindow(w), w->onClosingData)) uiControlDestroy(uiControl(w));