From: "彭浩" Subject: user32:-send-WM_PRINTCLIENT-when-PW_CLIENTONLY-is-set Message-Id: Date: Mon, 19 Jan 2015 16:55:50 +0800 according to the MSDN, when applications call PrintWindow with PW_CLIENTONLY flag, window should receive WM_PRINTCLEINT message: The application that owns the window referenced by hWnd processes the PrintWindow call and renders the image in the device context that is referenced by hdcBlt. The application receives a WM_PRINT message or, if the PW_PRINTCLIENT flag is specified, a WM_PRINTCLIENT message. For more information, seeWM_PRINT and WM_PRINTCLIENT. dlls/user32/painting.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) ------------------ Cole.Peng Wuhan Deepin Technology Co.,ltd tel:(+86)13697355813 QQ:376617721 Skype:live:phcourage diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c index 5c1dc69..a8fc244 100644 --- a/dlls/user32/painting.c +++ b/dlls/user32/painting.c @@ -1698,11 +1698,16 @@ BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *c */ BOOL WINAPI PrintWindow(HWND hwnd, HDC hdcBlt, UINT nFlags) { - UINT flags = PRF_CHILDREN | PRF_ERASEBKGND | PRF_OWNED | PRF_CLIENT; - if(!(nFlags & PW_CLIENTONLY)) + UINT msg, flags = PRF_CHILDREN | PRF_ERASEBKGND | PRF_OWNED | PRF_CLIENT; + if(nFlags & PW_CLIENTONLY) + { + msg = WM_PRINTCLIENT; + } + else { flags |= PRF_NONCLIENT; + msg = WM_PRINT; } - SendMessageW(hwnd, WM_PRINT, (WPARAM)hdcBlt, flags); + SendMessageW(hwnd, msg, (WPARAM)hdcBlt, flags); return TRUE; }