GetParent vs. GetAncestor

Ulrich Czekalla ulrich.czekalla at utoronto.ca
Tue Mar 22 09:26:45 CST 2005


GetParent may return the windows owner instead of the actual parent so we
should use GetAncestor to get the actual parent. This is particularly
important when we're mucking around with window management.

This patch just changes one instance that was preventing my
application from working but this seems to be a problem in various files
(mdi.c comes to mind).

ChangeLog:
    Ulrich Czekalla <ulrich at codeweavers.com>
    Use GetAncestor instead of GetParent
-------------- next part --------------
Index: windows/winpos.c
===================================================================
RCS file: /home/wine/wine/windows/winpos.c,v
retrieving revision 1.166
diff -u -p -r1.166 winpos.c
--- windows/winpos.c	1 Feb 2005 18:53:59 -0000	1.166
+++ windows/winpos.c	22 Mar 2005 14:58:21 -0000
@@ -744,7 +744,7 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, PO
         if ((style & WS_CAPTION) == WS_CAPTION)
             style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
 
-        GetClientRect(GetParent(hwnd), &rc);
+        GetClientRect(GetAncestor(hwnd,GA_PARENT), &rc);
         AdjustWindowRectEx(&rc, style, 0, exstyle);
 
         /* avoid calculating this twice */


More information about the wine-patches mailing list