From 7ba70583b965a0f2d31240506635b0afcbbb6f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Sun, 18 May 2003 06:47:19 +0000 Subject: [PATCH] Generate WM_PAINT messages in PeekMessage() svn path=/trunk/; revision=4706 --- reactos/subsys/win32k/ntuser/message.c | 39 ++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/reactos/subsys/win32k/ntuser/message.c b/reactos/subsys/win32k/ntuser/message.c index e5b40fb1764..015af9f336d 100644 --- a/reactos/subsys/win32k/ntuser/message.c +++ b/reactos/subsys/win32k/ntuser/message.c @@ -1,4 +1,4 @@ -/* $Id: message.c,v 1.16 2003/05/11 12:29:41 jfilby Exp $ +/* $Id: message.c,v 1.17 2003/05/18 06:47:19 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -316,7 +316,42 @@ NtUserPeekMessage(LPMSG lpMsg, /* Check for sent messages again. */ while (MsqDispatchOneSentMessage(ThreadQueue)); - /* FIXME: Check for paint messages. */ + /* Check for paint messages. */ + + /* Check for paint messages. */ + if (ThreadQueue->PaintPosted) + { + PWINDOW_OBJECT WindowObject; + + lpMsg->hwnd = PaintingFindWinToRepaint(hWnd, PsGetWin32Thread()); + lpMsg->message = WM_PAINT; + lpMsg->wParam = lpMsg->lParam = 0; + + WindowObject = W32kGetWindowObject(lpMsg->hwnd); + if (WindowObject != NULL) + { + if (WindowObject->Style & WS_MINIMIZE && + (HICON)NtUserGetClassLong(lpMsg->hwnd, GCL_HICON) != NULL) + { + lpMsg->message = WM_PAINTICON; + lpMsg->wParam = 1; + } + + if (lpMsg->hwnd == NULL || lpMsg->hwnd == hWnd || + W32kIsChildWindow(hWnd, lpMsg->hwnd)) + { + if (WindowObject->Flags & WINDOWOBJECT_NEED_INTERNALPAINT && + WindowObject->UpdateRegion == NULL) + { + WindowObject->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT; + MsqDecPaintCountQueue(WindowObject->MessageQueue); + } + } + W32kReleaseWindowObject(WindowObject); + } + + return(TRUE); + } return FALSE; }