- CreateWindowsEx: Patch based on janderwald patch.
    1. Reading and follow wine source (user/win.c & winex11.drv/window.c), I noticed that cs->hwndParent is unmodified when passed to the children via WM_NC/CREATE.
    2. Reordered the "fine the parent" code, based on wine. I've tested this change for last two weeks.

svn path=/trunk/; revision=23428
This commit is contained in:
James Tabor 2006-08-02 23:39:53 +00:00
parent 4546ac2820
commit db09492d5f

View file

@ -1439,16 +1439,14 @@ co_IntCreateWindowEx(DWORD dwExStyle,
} }
else if (hWndParent) else if (hWndParent)
{ {
if (((dwStyle & (WS_CHILD | WS_POPUP)) == WS_CHILD) || if ((dwStyle & (WS_CHILD | WS_POPUP)) == WS_CHILD)
(dwExStyle & WS_EX_MDICHILD)) { //temp hack
ParentWindowHandle = hWndParent;
else
{
//temp hack
PWINDOW_OBJECT Par = UserGetWindowObject(hWndParent), Root; PWINDOW_OBJECT Par = UserGetWindowObject(hWndParent), Root;
if (Par && (Root = UserGetAncestor(Par, GA_ROOT))) if (Par && (Root = UserGetAncestor(Par, GA_ROOT)))
OwnerWindowHandle = Root->hSelf; OwnerWindowHandle = Root->hSelf;
} }
else
ParentWindowHandle = hWndParent;
} }
else if ((dwStyle & (WS_CHILD | WS_POPUP)) == WS_CHILD) else if ((dwStyle & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{ {
@ -1685,7 +1683,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
Cs.lpCreateParams = lpParam; Cs.lpCreateParams = lpParam;
Cs.hInstance = hInstance; Cs.hInstance = hInstance;
Cs.hMenu = hMenu; Cs.hMenu = hMenu;
Cs.hwndParent = ParentWindowHandle; Cs.hwndParent = hWndParent; //Pass the original Parent handle!
Cs.cx = Size.cx; Cs.cx = Size.cx;
Cs.cy = Size.cy; Cs.cy = Size.cy;
Cs.x = Pos.x; Cs.x = Pos.x;