Simple optimization in EnableWindow.

This commit is contained in:
Aric Stewart 2003-06-23 20:02:01 +00:00 committed by Alexandre Julliard
parent 007196651f
commit 6fcf40197c
1 changed files with 6 additions and 2 deletions

View File

@ -1716,14 +1716,18 @@ BOOL WINAPI EnableWindow( HWND hwnd, BOOL enable )
}
else if (!enable && !retvalue)
{
HWND focus_wnd, capture_wnd;
SendMessageA( hwnd, WM_CANCELMODE, 0, 0);
WIN_SetStyle( hwnd, style | WS_DISABLED );
if (hwnd == GetFocus() || IsChild(hwnd, GetFocus()))
focus_wnd = GetFocus();
if (hwnd == focus_wnd || IsChild(hwnd, focus_wnd))
SetFocus( 0 ); /* A disabled window can't have the focus */
if (hwnd == GetCapture() || IsChild(hwnd, GetCapture()))
capture_wnd = GetCapture();
if (hwnd == capture_wnd || IsChild(hwnd, capture_wnd))
ReleaseCapture(); /* A disabled window can't capture the mouse */
SendMessageA( hwnd, WM_ENABLE, FALSE, 0 );