Ensure the validity of hOldFocus before calling WIN_GetTopParent.

This commit is contained in:
Jean-Claude Batista 2000-07-15 19:44:04 +00:00 committed by Alexandre Julliard
parent f6e4096194
commit 69d39ab023

View file

@ -1855,7 +1855,7 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus)
{
HWND hOldFocus = PERQDATA_GetFocusWnd( pNewActiveQueue->pQData );
if ( WIN_GetTopParent( hOldFocus ) != hwndActive )
if ( hOldFocus && WIN_GetTopParent( hOldFocus ) != hwndActive )
FOCUS_SwitchFocus( pNewActiveQueue, hOldFocus,
(wndPtr && (wndPtr->dwStyle & WS_MINIMIZE))?
0 : hwndActive );