Changed SetParent32 to adhere to Windows behaviour (mostly),
which should also keep it from leaving garbage around.
This commit is contained in:
parent
42d1255857
commit
72d8dbe38a
|
@ -1932,17 +1932,27 @@ HWND16 WINAPI SetParent16( HWND16 hwndChild, HWND16 hwndNewParent )
|
||||||
HWND32 WINAPI SetParent32( HWND32 hwndChild, HWND32 hwndNewParent )
|
HWND32 WINAPI SetParent32( HWND32 hwndChild, HWND32 hwndNewParent )
|
||||||
{
|
{
|
||||||
WND *wndPtr = WIN_FindWndPtr( hwndChild );
|
WND *wndPtr = WIN_FindWndPtr( hwndChild );
|
||||||
|
DWORD dwStyle = (wndPtr)?(wndPtr->dwStyle):0;
|
||||||
WND *pWndNewParent =
|
WND *pWndNewParent =
|
||||||
(hwndNewParent) ? WIN_FindWndPtr( hwndNewParent ) : pWndDesktop;
|
(hwndNewParent) ? WIN_FindWndPtr( hwndNewParent ) : pWndDesktop;
|
||||||
WND *pWndOldParent =
|
WND *pWndOldParent;
|
||||||
(wndPtr)?(*wndPtr->pDriver->pSetParent)(wndPtr, pWndNewParent):NULL;
|
|
||||||
|
/* Windows hides the window first, then shows it again
|
||||||
|
* including the WM_SHOWWINDOW messages and all */
|
||||||
|
if (dwStyle & WS_VISIBLE)
|
||||||
|
ShowWindow32( hwndChild, SW_HIDE );
|
||||||
|
|
||||||
|
pWndOldParent = (wndPtr)?(*wndPtr->pDriver->pSetParent)(wndPtr, pWndNewParent):NULL;
|
||||||
|
|
||||||
/* SetParent32 additionally needs to make hwndChild the topmost window
|
/* SetParent32 additionally needs to make hwndChild the topmost window
|
||||||
in the x-order and send the expected WM_WINDOWPOSCHANGING and
|
in the x-order and send the expected WM_WINDOWPOSCHANGING and
|
||||||
WM_WINDOWPOSCHANGED notification messages.
|
WM_WINDOWPOSCHANGED notification messages.
|
||||||
*/
|
*/
|
||||||
SetWindowPos32( hwndChild, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
|
SetWindowPos32( hwndChild, HWND_TOPMOST, 0, 0, 0, 0,
|
||||||
|
SWP_NOMOVE|SWP_NOSIZE|((dwStyle & WS_VISIBLE)?SWP_SHOWWINDOW:0));
|
||||||
|
/* FIXME: a WM_MOVE is also generated (in the DefWindowProc handler
|
||||||
|
* for WM_WINDOWPOSCHANGED) in Windows, should probably remove SWP_NOMOVE */
|
||||||
|
|
||||||
return pWndOldParent?pWndOldParent->hwndSelf:0;
|
return pWndOldParent?pWndOldParent->hwndSelf:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue