Handle WM_PRINTCLIENT.

Don't use SelectClipRgn in WM_PRINTCLIENT.
This commit is contained in:
Michael Kaufmann 2005-11-08 12:52:35 +00:00 committed by Alexandre Julliard
parent 2e9bff702c
commit e9310da57b
21 changed files with 25 additions and 14 deletions

View File

@ -899,6 +899,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
case WM_TIMER: case WM_TIMER:
return ANIMATE_Timer(infoPtr); return ANIMATE_Timer(infoPtr);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
{ {
/* the animation isn't playing, or has not decompressed /* the animation isn't playing, or has not decompressed

View File

@ -1284,6 +1284,7 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_GETDLGCODE: case WM_GETDLGCODE:
return DLGC_WANTARROWS | DLGC_WANTCHARS; return DLGC_WANTARROWS | DLGC_WANTCHARS;
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return DATETIME_Paint (infoPtr, (HDC)wParam); return DATETIME_Paint (infoPtr, (HDC)wParam);

View File

@ -1717,6 +1717,7 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_THEMECHANGED: case WM_THEMECHANGED:
return HEADER_ThemeChanged (hwnd); return HEADER_ThemeChanged (hwnd);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return HEADER_Paint (hwnd, wParam); return HEADER_Paint (hwnd, wParam);

View File

@ -516,6 +516,7 @@ HOTKEY_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NCCREATE: case WM_NCCREATE:
return HOTKEY_NCCreate (hwnd, (LPCREATESTRUCTW)lParam); return HOTKEY_NCCreate (hwnd, (LPCREATESTRUCTW)lParam);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
HOTKEY_Paint(infoPtr, (HDC)wParam); HOTKEY_Paint(infoPtr, (HDC)wParam);
return 0; return 0;

View File

@ -2007,6 +2007,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_LBUTTONUP: case WM_LBUTTONUP:
return MONTHCAL_LButtonUp(infoPtr, lParam); return MONTHCAL_LButtonUp(infoPtr, lParam);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return MONTHCAL_Paint(infoPtr, wParam); return MONTHCAL_Paint(infoPtr, wParam);

View File

@ -34,6 +34,8 @@
* PGS_DRAGNDROP * PGS_DRAGNDROP
* Notifications: * Notifications:
* PGN_HOTITEMCHANGE * PGN_HOTITEMCHANGE
* Messages:
* WM_PRINT and/or WM_PRINTCLIENT
* *
* TESTING: * TESTING:
* Tested primarily with the controlspy Pager application. * Tested primarily with the controlspy Pager application.

View File

@ -627,6 +627,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
case WM_SETFONT: case WM_SETFONT:
return (LRESULT)PROGRESS_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam); return (LRESULT)PROGRESS_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return PROGRESS_Paint (infoPtr, (HDC)wParam); return PROGRESS_Paint (infoPtr, (HDC)wParam);

View File

@ -3455,6 +3455,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TRUE; return TRUE;
} }
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
PROPSHEET_Paint(hwnd, (HDC)wParam); PROPSHEET_Paint(hwnd, (HDC)wParam);
return TRUE; return TRUE;

View File

@ -50,7 +50,6 @@
* - WM_LBUTTONDBLCLK * - WM_LBUTTONDBLCLK
* - WM_MEASUREITEM * - WM_MEASUREITEM
* - WM_PALETTECHANGED * - WM_PALETTECHANGED
* - WM_PRINTCLIENT
* - WM_QUERYNEWPALETTE * - WM_QUERYNEWPALETTE
* - WM_RBUTTONDOWN * - WM_RBUTTONDOWN
* - WM_RBUTTONUP * - WM_RBUTTONUP
@ -4768,11 +4767,11 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFYFORMAT: case WM_NOTIFYFORMAT:
return REBAR_NotifyFormat (infoPtr, wParam, lParam); return REBAR_NotifyFormat (infoPtr, wParam, lParam);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return REBAR_Paint (infoPtr, wParam, lParam); return REBAR_Paint (infoPtr, wParam, lParam);
/* case WM_PALETTECHANGED: supported according to ControlSpy */ /* case WM_PALETTECHANGED: supported according to ControlSpy */
/* case WM_PRINTCLIENT: supported according to ControlSpy */
/* case WM_QUERYNEWPALETTE:supported according to ControlSpy */ /* case WM_QUERYNEWPALETTE:supported according to ControlSpy */
/* case WM_RBUTTONDOWN: supported according to ControlSpy */ /* case WM_RBUTTONDOWN: supported according to ControlSpy */
/* case WM_RBUTTONUP: supported according to ControlSpy */ /* case WM_RBUTTONUP: supported according to ControlSpy */

View File

@ -1342,6 +1342,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFYFORMAT: case WM_NOTIFYFORMAT:
return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam); return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return STATUSBAR_WMPaint (infoPtr, (HDC)wParam); return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);

View File

@ -1463,6 +1463,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
return DefWindowProcW( hwnd, message, wParam, lParam ); return DefWindowProcW( hwnd, message, wParam, lParam );
switch(message) { switch(message) {
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return SYSLINK_Paint (infoPtr, (HDC)wParam); return SYSLINK_Paint (infoPtr, (HDC)wParam);

View File

@ -3283,6 +3283,7 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return TAB_MouseMove (infoPtr, wParam, lParam); return TAB_MouseMove (infoPtr, wParam, lParam);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return TAB_Paint (infoPtr, (HDC)wParam); return TAB_Paint (infoPtr, (HDC)wParam);

View File

@ -7234,6 +7234,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFYFORMAT: case WM_NOTIFYFORMAT:
return TOOLBAR_NotifyFormat (infoPtr, wParam, lParam); return TOOLBAR_NotifyFormat (infoPtr, wParam, lParam);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return TOOLBAR_Paint (hwnd, wParam); return TOOLBAR_Paint (hwnd, wParam);

View File

@ -2782,6 +2782,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFYFORMAT: case WM_NOTIFYFORMAT:
return TOOLTIPS_NotifyFormat (hwnd, wParam, lParam); return TOOLTIPS_NotifyFormat (hwnd, wParam, lParam);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return TOOLTIPS_Paint (hwnd, wParam, lParam); return TOOLTIPS_Paint (hwnd, wParam, lParam);

View File

@ -1878,6 +1878,7 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return TRACKBAR_MouseMove (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); return TRACKBAR_MouseMove (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return TRACKBAR_Paint (infoPtr, (HDC)wParam); return TRACKBAR_Paint (infoPtr, (HDC)wParam);

View File

@ -5629,11 +5629,10 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFYFORMAT: case WM_NOTIFYFORMAT:
return TREEVIEW_NotifyFormat(infoPtr, (HWND)wParam, (UINT)lParam); return TREEVIEW_NotifyFormat(infoPtr, (HWND)wParam, (UINT)lParam);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return TREEVIEW_Paint(infoPtr, wParam); return TREEVIEW_Paint(infoPtr, wParam);
/* WM_PRINTCLIENT */
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN:
return TREEVIEW_RButtonDown(infoPtr, lParam); return TREEVIEW_RButtonDown(infoPtr, lParam);

View File

@ -934,6 +934,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
return UPDOWN_KeyPressed(infoPtr, (int)wParam); return UPDOWN_KeyPressed(infoPtr, (int)wParam);
break; break;
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return UPDOWN_Paint (infoPtr, (HDC)wParam); return UPDOWN_Paint (infoPtr, (HDC)wParam);

View File

@ -279,6 +279,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
} }
return 1; return 1;
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
if (btnPaintFunc[btn_type]) if (btnPaintFunc[btn_type])
{ {
@ -777,7 +778,6 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
{ {
RECT rc, focus_rect, r; RECT rc, focus_rect, r;
UINT dtFlags, uState; UINT dtFlags, uState;
HRGN hRgn;
HPEN hOldPen; HPEN hOldPen;
HBRUSH hOldBrush; HBRUSH hOldBrush;
INT oldBkMode; INT oldBkMode;
@ -834,16 +834,13 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
if (pushedState) if (pushedState)
OffsetRect(&r, 1, 1); OffsetRect(&r, 1, 1);
hRgn = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom); IntersectClipRect(hDC, rc.left, rc.top, rc.right, rc.bottom);
SelectClipRgn(hDC, hRgn);
oldTxtColor = SetTextColor( hDC, GetSysColor(COLOR_BTNTEXT) ); oldTxtColor = SetTextColor( hDC, GetSysColor(COLOR_BTNTEXT) );
BUTTON_DrawLabel(hwnd, hDC, dtFlags, &r); BUTTON_DrawLabel(hwnd, hDC, dtFlags, &r);
SetTextColor( hDC, oldTxtColor ); SetTextColor( hDC, oldTxtColor );
SelectClipRgn(hDC, 0);
DeleteObject(hRgn);
if (state & BUTTON_HASFOCUS) if (state & BUTTON_HASFOCUS)
{ {
@ -868,7 +865,6 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
HBRUSH hBrush; HBRUSH hBrush;
int delta; int delta;
UINT dtFlags; UINT dtFlags;
HRGN hRgn;
HFONT hFont; HFONT hFont;
LONG state = get_button_state( hwnd ); LONG state = get_button_state( hwnd );
LONG style = GetWindowLongW( hwnd, GWL_STYLE ); 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 */ if (dtFlags == (UINT)-1L) /* Noting to draw */
return; return;
hRgn = CreateRectRgn(client.left, client.top, client.right, client.bottom);
SelectClipRgn(hDC, hRgn); IntersectClipRect(hDC, client.left, client.top, client.right, client.bottom);
DeleteObject(hRgn);
if (action == ODA_DRAWENTIRE) if (action == ODA_DRAWENTIRE)
BUTTON_DrawLabel(hwnd, hDC, dtFlags, &rtext); BUTTON_DrawLabel(hwnd, hDC, dtFlags, &rtext);
@ -986,7 +981,6 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
IntersectRect(&rtext, &rtext, &client); IntersectRect(&rtext, &rtext, &client);
DrawFocusRect( hDC, &rtext ); DrawFocusRect( hDC, &rtext );
} }
SelectClipRgn(hDC, 0);
} }

View File

@ -920,6 +920,7 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
result = EDIT_WM_MouseMove(es, (short)LOWORD(lParam), (short)HIWORD(lParam)); result = EDIT_WM_MouseMove(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
break; break;
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
EDIT_WM_Paint(es, (HDC)wParam); EDIT_WM_Paint(es, (HDC)wParam);
break; break;

View File

@ -3013,6 +3013,7 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,
case WM_GETDLGCODE: case WM_GETDLGCODE:
return DLGC_WANTARROWS | DLGC_WANTCHARS; return DLGC_WANTARROWS | DLGC_WANTCHARS;
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
{ {
PAINTSTRUCT ps; PAINTSTRUCT ps;

View File

@ -282,6 +282,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
else return unicode ? DefWindowProcW(hwnd, uMsg, wParam, lParam) : else return unicode ? DefWindowProcW(hwnd, uMsg, wParam, lParam) :
DefWindowProcA(hwnd, uMsg, wParam, lParam); DefWindowProcA(hwnd, uMsg, wParam, lParam);
case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
{ {
PAINTSTRUCT ps; PAINTSTRUCT ps;