Only modify the ancestor if you find it.

This commit is contained in:
Bill Medland 2001-10-17 19:35:36 +00:00 committed by Alexandre Julliard
parent 4b62618122
commit 3d4d0862bb
1 changed files with 7 additions and 5 deletions

View File

@ -1339,12 +1339,14 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus)
{
/* walk up to the first unowned window */
HWND tmp = GetAncestor( hWnd, GA_ROOTOWNER );
wndTemp = WIN_FindWndPtr( tmp );
if ((wndTemp = WIN_FindWndPtr( tmp )))
{
/* and set last active owned popup */
wndTemp->hwndLastActive = hWnd;
wIconized = HIWORD(wndTemp->dwStyle & WS_MINIMIZE);
WIN_ReleaseWndPtr(wndTemp);
}
SendMessageA( hWnd, WM_NCACTIVATE, TRUE, 0 );
SendMessageA( hWnd, WM_ACTIVATE,
MAKEWPARAM( (fMouse) ? WA_CLICKACTIVE : WA_ACTIVE, wIconized),