diff --git a/reactos/dll/win32/user32/windows/input.c b/reactos/dll/win32/user32/windows/input.c index 0d4fe32b36e..ed5a7138ee7 100644 --- a/reactos/dll/win32/user32/windows/input.c +++ b/reactos/dll/win32/user32/windows/input.c @@ -347,9 +347,12 @@ EnableWindow(HWND hWnd, } else { - /* Remove keyboard focus from that window */ - SetFocus(NULL); Style |= WS_DISABLED; + /* Remove keyboard focus from that window if it had focus */ + if (hWnd == GetFocus()) + { + SetFocus(NULL); + } } NtUserSetWindowLong(hWnd, GWL_STYLE, Style, FALSE);