From e9310da57b335a4ce3ba09f07657fd4c1ba21045 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Tue, 8 Nov 2005 12:52:35 +0000 Subject: [PATCH] Handle WM_PRINTCLIENT. Don't use SelectClipRgn in WM_PRINTCLIENT. --- dlls/comctl32/animate.c | 1 + dlls/comctl32/datetime.c | 1 + dlls/comctl32/header.c | 1 + dlls/comctl32/hotkey.c | 1 + dlls/comctl32/monthcal.c | 1 + dlls/comctl32/pager.c | 2 ++ dlls/comctl32/progress.c | 1 + dlls/comctl32/propsheet.c | 1 + dlls/comctl32/rebar.c | 3 +-- dlls/comctl32/status.c | 1 + dlls/comctl32/syslink.c | 1 + dlls/comctl32/tab.c | 1 + dlls/comctl32/toolbar.c | 1 + dlls/comctl32/tooltips.c | 1 + dlls/comctl32/trackbar.c | 1 + dlls/comctl32/treeview.c | 3 +-- dlls/comctl32/updown.c | 1 + dlls/user/button.c | 14 ++++---------- dlls/user/edit.c | 1 + dlls/user/listbox.c | 1 + dlls/user/static.c | 1 + 21 files changed, 25 insertions(+), 14 deletions(-) diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c index 6d06d221ebd..3c2c64825f9 100644 --- a/dlls/comctl32/animate.c +++ b/dlls/comctl32/animate.c @@ -899,6 +899,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP case WM_TIMER: return ANIMATE_Timer(infoPtr); + case WM_PRINTCLIENT: case WM_PAINT: { /* the animation isn't playing, or has not decompressed diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index f024207b21d..83d53af56ee 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -1284,6 +1284,7 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETDLGCODE: return DLGC_WANTARROWS | DLGC_WANTCHARS; + case WM_PRINTCLIENT: case WM_PAINT: return DATETIME_Paint (infoPtr, (HDC)wParam); diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index ae611b99094..522aa81891e 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -1717,6 +1717,7 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_THEMECHANGED: return HEADER_ThemeChanged (hwnd); + case WM_PRINTCLIENT: case WM_PAINT: return HEADER_Paint (hwnd, wParam); diff --git a/dlls/comctl32/hotkey.c b/dlls/comctl32/hotkey.c index ab8d7465cbf..635916483f1 100644 --- a/dlls/comctl32/hotkey.c +++ b/dlls/comctl32/hotkey.c @@ -516,6 +516,7 @@ HOTKEY_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NCCREATE: return HOTKEY_NCCreate (hwnd, (LPCREATESTRUCTW)lParam); + case WM_PRINTCLIENT: case WM_PAINT: HOTKEY_Paint(infoPtr, (HDC)wParam); return 0; diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index 4214eed8d60..340b68142f2 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -2007,6 +2007,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_LBUTTONUP: return MONTHCAL_LButtonUp(infoPtr, lParam); + case WM_PRINTCLIENT: case WM_PAINT: return MONTHCAL_Paint(infoPtr, wParam); diff --git a/dlls/comctl32/pager.c b/dlls/comctl32/pager.c index 971da4e1b89..cd25159d16e 100644 --- a/dlls/comctl32/pager.c +++ b/dlls/comctl32/pager.c @@ -34,6 +34,8 @@ * PGS_DRAGNDROP * Notifications: * PGN_HOTITEMCHANGE + * Messages: + * WM_PRINT and/or WM_PRINTCLIENT * * TESTING: * Tested primarily with the controlspy Pager application. diff --git a/dlls/comctl32/progress.c b/dlls/comctl32/progress.c index a6e20e5e9cc..eb0b11a4172 100644 --- a/dlls/comctl32/progress.c +++ b/dlls/comctl32/progress.c @@ -627,6 +627,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, case WM_SETFONT: return (LRESULT)PROGRESS_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam); + case WM_PRINTCLIENT: case WM_PAINT: return PROGRESS_Paint (infoPtr, (HDC)wParam); diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index 783ae3e3a09..08c55b8bfee 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -3455,6 +3455,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE; } + case WM_PRINTCLIENT: case WM_PAINT: PROPSHEET_Paint(hwnd, (HDC)wParam); return TRUE; diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index 3f167baf847..61806f44d98 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -50,7 +50,6 @@ * - WM_LBUTTONDBLCLK * - WM_MEASUREITEM * - WM_PALETTECHANGED - * - WM_PRINTCLIENT * - WM_QUERYNEWPALETTE * - WM_RBUTTONDOWN * - WM_RBUTTONUP @@ -4768,11 +4767,11 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NOTIFYFORMAT: return REBAR_NotifyFormat (infoPtr, wParam, lParam); + case WM_PRINTCLIENT: case WM_PAINT: return REBAR_Paint (infoPtr, wParam, lParam); /* case WM_PALETTECHANGED: supported according to ControlSpy */ -/* case WM_PRINTCLIENT: supported according to ControlSpy */ /* case WM_QUERYNEWPALETTE:supported according to ControlSpy */ /* case WM_RBUTTONDOWN: supported according to ControlSpy */ /* case WM_RBUTTONUP: supported according to ControlSpy */ diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index c730400d344..7c86815a484 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -1342,6 +1342,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_NOTIFYFORMAT: return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam); + case WM_PRINTCLIENT: case WM_PAINT: return STATUSBAR_WMPaint (infoPtr, (HDC)wParam); diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 12a06055648..084a56762ed 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -1463,6 +1463,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message, return DefWindowProcW( hwnd, message, wParam, lParam ); switch(message) { + case WM_PRINTCLIENT: case WM_PAINT: return SYSLINK_Paint (infoPtr, (HDC)wParam); diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index e36ddf60ba4..dd9dbe51dc2 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -3283,6 +3283,7 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_MOUSEMOVE: return TAB_MouseMove (infoPtr, wParam, lParam); + case WM_PRINTCLIENT: case WM_PAINT: return TAB_Paint (infoPtr, (HDC)wParam); diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index cf6a03bbf48..64be7ec9289 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -7234,6 +7234,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NOTIFYFORMAT: return TOOLBAR_NotifyFormat (infoPtr, wParam, lParam); + case WM_PRINTCLIENT: case WM_PAINT: return TOOLBAR_Paint (hwnd, wParam); diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c index e641aaaba09..b738a4ea011 100644 --- a/dlls/comctl32/tooltips.c +++ b/dlls/comctl32/tooltips.c @@ -2782,6 +2782,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NOTIFYFORMAT: return TOOLTIPS_NotifyFormat (hwnd, wParam, lParam); + case WM_PRINTCLIENT: case WM_PAINT: return TOOLTIPS_Paint (hwnd, wParam, lParam); diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 5b113ec1731..7094e049994 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -1878,6 +1878,7 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_MOUSEMOVE: return TRACKBAR_MouseMove (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); + case WM_PRINTCLIENT: case WM_PAINT: return TRACKBAR_Paint (infoPtr, (HDC)wParam); diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index e6cd167bd2f..c148d83c9d2 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -5629,11 +5629,10 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NOTIFYFORMAT: return TREEVIEW_NotifyFormat(infoPtr, (HWND)wParam, (UINT)lParam); + case WM_PRINTCLIENT: case WM_PAINT: return TREEVIEW_Paint(infoPtr, wParam); - /* WM_PRINTCLIENT */ - case WM_RBUTTONDOWN: return TREEVIEW_RButtonDown(infoPtr, lParam); diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index d8898815f3a..cda2668d953 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -934,6 +934,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L return UPDOWN_KeyPressed(infoPtr, (int)wParam); break; + case WM_PRINTCLIENT: case WM_PAINT: return UPDOWN_Paint (infoPtr, (HDC)wParam); diff --git a/dlls/user/button.c b/dlls/user/button.c index a723a841dd8..5d56db7c06b 100644 --- a/dlls/user/button.c +++ b/dlls/user/button.c @@ -279,6 +279,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, } return 1; + case WM_PRINTCLIENT: case WM_PAINT: if (btnPaintFunc[btn_type]) { @@ -777,7 +778,6 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) { RECT rc, focus_rect, r; UINT dtFlags, uState; - HRGN hRgn; HPEN hOldPen; HBRUSH hOldBrush; INT oldBkMode; @@ -834,16 +834,13 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) if (pushedState) OffsetRect(&r, 1, 1); - hRgn = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom); - SelectClipRgn(hDC, hRgn); + IntersectClipRect(hDC, rc.left, rc.top, rc.right, rc.bottom); oldTxtColor = SetTextColor( hDC, GetSysColor(COLOR_BTNTEXT) ); BUTTON_DrawLabel(hwnd, hDC, dtFlags, &r); SetTextColor( hDC, oldTxtColor ); - SelectClipRgn(hDC, 0); - DeleteObject(hRgn); if (state & BUTTON_HASFOCUS) { @@ -868,7 +865,6 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) HBRUSH hBrush; int delta; UINT dtFlags; - HRGN hRgn; HFONT hFont; LONG state = get_button_state( hwnd ); LONG style = GetWindowLongW( hwnd, GWL_STYLE ); @@ -970,9 +966,8 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) if (dtFlags == (UINT)-1L) /* Noting to draw */ return; - hRgn = CreateRectRgn(client.left, client.top, client.right, client.bottom); - SelectClipRgn(hDC, hRgn); - DeleteObject(hRgn); + + IntersectClipRect(hDC, client.left, client.top, client.right, client.bottom); if (action == ODA_DRAWENTIRE) BUTTON_DrawLabel(hwnd, hDC, dtFlags, &rtext); @@ -986,7 +981,6 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) IntersectRect(&rtext, &rtext, &client); DrawFocusRect( hDC, &rtext ); } - SelectClipRgn(hDC, 0); } diff --git a/dlls/user/edit.c b/dlls/user/edit.c index 28d8032fdca..2d92e94234f 100644 --- a/dlls/user/edit.c +++ b/dlls/user/edit.c @@ -920,6 +920,7 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, result = EDIT_WM_MouseMove(es, (short)LOWORD(lParam), (short)HIWORD(lParam)); break; + case WM_PRINTCLIENT: case WM_PAINT: EDIT_WM_Paint(es, (HDC)wParam); break; diff --git a/dlls/user/listbox.c b/dlls/user/listbox.c index 167effd9d21..a7f968739d3 100644 --- a/dlls/user/listbox.c +++ b/dlls/user/listbox.c @@ -3013,6 +3013,7 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg, case WM_GETDLGCODE: return DLGC_WANTARROWS | DLGC_WANTCHARS; + case WM_PRINTCLIENT: case WM_PAINT: { PAINTSTRUCT ps; diff --git a/dlls/user/static.c b/dlls/user/static.c index 65a1249f70d..365687cbda2 100644 --- a/dlls/user/static.c +++ b/dlls/user/static.c @@ -282,6 +282,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, else return unicode ? DefWindowProcW(hwnd, uMsg, wParam, lParam) : DefWindowProcA(hwnd, uMsg, wParam, lParam); + case WM_PRINTCLIENT: case WM_PAINT: { PAINTSTRUCT ps; -- 2.11.4.GIT