From: Esme Povirk esme@codeweavers.com
--- dlls/user32/tests/msg.c | 8 ++++---- dlls/win32u/window.c | 9 ++++++++- 2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index f7990270418..3fdf120c358 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -2009,7 +2009,7 @@ static const struct message WmSetRedrawTrueSeq[] = static const struct message WmEnableWindowSeq_1[] = { { WM_CANCELMODE, sent|wparam|lparam, 0, 0 }, - { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 }, { HCBT_SETFOCUS, hook|optional }, { WM_KILLFOCUS, sent|optional }, { WM_ENABLE, sent|wparam|lparam, FALSE, 0 }, @@ -2025,7 +2025,7 @@ static const struct message WmEnableWindowSeq_2[] =
static const struct message WmEnableWindowSeq_3[] = { - { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 }, { WM_ENABLE, sent|wparam|lparam, TRUE, 0 }, { 0 } }; @@ -15991,7 +15991,7 @@ static void test_dialog_messages(void) static void test_enddialog_seq(HWND dialog, HWND owner) { const struct message seq[] = { - { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 }, { WM_ENABLE, sent }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE }, { HCBT_ACTIVATE, hook|wparam, (WPARAM)owner }, @@ -16019,7 +16019,7 @@ static void test_enddialog_seq(HWND dialog, HWND owner) static void test_enddialog_seq2(HWND dialog, HWND owner) { const struct message seq[] = { - { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 }, { WM_ENABLE, parent|sent }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE }, { HCBT_ACTIVATE, hook|wparam, (WPARAM)owner }, diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index e5da6be30e0..4499e226a7b 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -825,7 +825,12 @@ BOOL enable_window( HWND hwnd, BOOL enable ) if (enable) { ret = (set_window_style( hwnd, 0, WS_DISABLED ) & WS_DISABLED) != 0; - if (ret) send_message( hwnd, WM_ENABLE, TRUE, 0 ); + if (ret) + { + NtUserNotifyWinEvent( EVENT_OBJECT_STATECHANGE, hwnd, OBJID_WINDOW, 0 ); + + send_message( hwnd, WM_ENABLE, TRUE, 0 ); + } } else { @@ -834,6 +839,8 @@ BOOL enable_window( HWND hwnd, BOOL enable ) ret = (set_window_style( hwnd, WS_DISABLED, 0 ) & WS_DISABLED) != 0; if (!ret) { + NtUserNotifyWinEvent( EVENT_OBJECT_STATECHANGE, hwnd, OBJID_WINDOW, 0 ); + if (hwnd == get_focus()) NtUserSetFocus( 0 ); /* A disabled window can't have the focus */