Commit 37025bda authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

joy.cpl: Process messages while waiting for the input threads.

Instead of interrupting the wait on any message.
parent 39dc9d09
...@@ -792,7 +792,16 @@ INT_PTR CALLBACK test_di_dialog_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM ...@@ -792,7 +792,16 @@ INT_PTR CALLBACK test_di_dialog_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM
case PSN_RESET: case PSN_RESET:
case PSN_KILLACTIVE: case PSN_KILLACTIVE:
SetEvent( thread_stop ); SetEvent( thread_stop );
MsgWaitForMultipleObjects( 1, &thread, FALSE, INFINITE, 0 ); /* wait for the input thread to stop, processing any WM_USER message from it */
while (MsgWaitForMultipleObjects( 1, &thread, FALSE, INFINITE, QS_ALLINPUT ) == 1)
{
MSG msg;
while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
{
TranslateMessage( &msg );
DispatchMessageW( &msg );
}
}
CloseHandle( state_event ); CloseHandle( state_event );
CloseHandle( thread_stop ); CloseHandle( thread_stop );
CloseHandle( thread ); CloseHandle( thread );
......
...@@ -428,7 +428,16 @@ extern INT_PTR CALLBACK test_xi_dialog_proc( HWND hwnd, UINT msg, WPARAM wparam, ...@@ -428,7 +428,16 @@ extern INT_PTR CALLBACK test_xi_dialog_proc( HWND hwnd, UINT msg, WPARAM wparam,
case PSN_RESET: case PSN_RESET:
case PSN_KILLACTIVE: case PSN_KILLACTIVE:
SetEvent( thread_stop ); SetEvent( thread_stop );
MsgWaitForMultipleObjects( 1, &thread, FALSE, INFINITE, 0 ); /* wait for the input thread to stop, processing any WM_USER message from it */
while (MsgWaitForMultipleObjects( 1, &thread, FALSE, INFINITE, QS_ALLINPUT ) == 1)
{
MSG msg;
while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
{
TranslateMessage( &msg );
DispatchMessageW( &msg );
}
}
CloseHandle( thread_stop ); CloseHandle( thread_stop );
CloseHandle( thread ); CloseHandle( thread );
dialog_hwnd = 0; dialog_hwnd = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment