Need to check for focus and capture also on the children of the window

being disabled.
This commit is contained in:
Alexandre Julliard 2002-04-08 23:57:08 +00:00
parent f6be044d62
commit 481f8ffeba
1 changed files with 2 additions and 2 deletions

View File

@ -1701,10 +1701,10 @@ BOOL WINAPI EnableWindow( HWND hwnd, BOOL enable )
WIN_SetStyle( hwnd, style | WS_DISABLED );
if (hwnd == GetFocus())
if (hwnd == GetFocus() || IsChild(hwnd, GetFocus()))
SetFocus( 0 ); /* A disabled window can't have the focus */
if (hwnd == GetCapture())
if (hwnd == GetCapture() || IsChild(hwnd, GetCapture()))
ReleaseCapture(); /* A disabled window can't capture the mouse */
SendMessageA( hwnd, WM_ENABLE, FALSE, 0 );