comctl32: pager make consider default size of child window

Hirofumi Katayama katayama.hirofumi.mz at gmail.com
Tue Apr 16 05:08:51 CDT 2013


This patch makes pager control to consider default size of child window.

If PGN_CALCSIZE notification message was not processed properly, the child
window of the pager control becomes wrong size. This patch fixes it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130416/1354101e/attachment-0001.html>
-------------- next part --------------
From f4104f82b51a5611f606880032dbd863da96f427 Mon Sep 17 00:00:00 2001
From: Hirofumi Katayama <katayama.hirofumi.mz at gmail.com>
Date: Tue, 16 Apr 2013 19:01:56 +0900
Subject: comctl32: pager make consider default size of child window

---
 dlls/comctl32/pager.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/comctl32/pager.c b/dlls/comctl32/pager.c
index 3b2c11c..a68c2c3 100644
--- a/dlls/comctl32/pager.c
+++ b/dlls/comctl32/pager.c
@@ -207,7 +207,13 @@ PAGER_GetBkColor(const PAGER_INFO *infoPtr)
 static void
 PAGER_CalcSize( PAGER_INFO *infoPtr )
 {
+    RECT rcChild;
     NMPGCALCSIZE nmpgcs;
+
+    GetWindowRect(infoPtr->hwndChild, &rcChild);
+    infoPtr->nWidth = rcChild.right - rcChild.left;
+    infoPtr->nHeight = rcChild.bottom - rcChild.top;
+
     ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
     nmpgcs.hdr.hwndFrom = infoPtr->hwndSelf;
     nmpgcs.hdr.idFrom   = GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_ID);
@@ -500,12 +506,18 @@ PAGER_SetButtonSize (PAGER_INFO* infoPtr, INT iButtonSize)
 static LRESULT
 PAGER_SetChild (PAGER_INFO* infoPtr, HWND hwndChild)
 {
+    RECT rcChild;
+
     infoPtr->hwndChild = IsWindow (hwndChild) ? hwndChild : 0;
 
     if (infoPtr->hwndChild)
     {
         TRACE("[%p] hwndChild=%p\n", infoPtr->hwndSelf, infoPtr->hwndChild);
 
+        GetWindowRect(infoPtr->hwndChild, &rcChild);
+        infoPtr->nWidth = rcChild.right - rcChild.left;
+        infoPtr->nHeight = rcChild.bottom - rcChild.top;
+
         SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
                      SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
 
-- 
1.8.1.msysgit.1


More information about the wine-patches mailing list