{ 0 }
};
-static int after_end_dialog, test_def_id;
+static BOOL after_end_dialog, test_def_id, paint_loop_done;
static int sequence_cnt, sequence_size;
static struct recvd_message* sequence;
static int log_all_parent_messages;
-static int paint_loop_done;
+static CRITICAL_SECTION sequence_cs;
/* user32 functions */
static HWND (WINAPI *pGetAncestor)(HWND,UINT);
{
struct recvd_message *seq;
- if (!sequence)
+ EnterCriticalSection( &sequence_cs );
+ if (!sequence)
{
sequence_size = 10;
sequence = HeapAlloc( GetProcessHeap(), 0, sequence_size * sizeof(*sequence) );
}
assert(sequence);
- seq = &sequence[sequence_cnt];
+ seq = &sequence[sequence_cnt++];
seq->hwnd = msg->hwnd;
seq->message = msg->message;
seq->flags = msg->flags;
seq->line = line;
seq->descr = msg->descr;
seq->output[0] = 0;
+ LeaveCriticalSection( &sequence_cs );
if (msg->descr)
{
sprintf( seq->output + strlen(seq->output), " (flags %x)", msg->flags );
}
}
-
- sequence_cnt++;
}
/* try to make sure pending X events have been processed before continuing */
static void flush_sequence(void)
{
+ EnterCriticalSection( &sequence_cs );
HeapFree(GetProcessHeap(), 0, sequence);
sequence = 0;
sequence_cnt = sequence_size = 0;
+ LeaveCriticalSection( &sequence_cs );
}
static void dump_sequence(const struct message *expected, const char *context, const char *file, int line)
ok_sequence_( (exp), (contx), (todo), __FILE__, __LINE__)
-static void ok_sequence_(const struct message *expected_list, const char *context, int todo,
+static void ok_sequence_(const struct message *expected_list, const char *context, BOOL todo,
const char *file, int line)
{
static const struct recvd_message end_of_sequence;
flush_sequence();
- test_def_id = 1;
+ test_def_id = TRUE;
SendMessageA(hwnd, WM_NULL, 0, 0);
flush_sequence();
- after_end_dialog = 1;
+ after_end_dialog = TRUE;
EndDialog( hwnd, 0 );
ok_sequence(WmEndCustomDialogSeq, "EndCustomDialog", FALSE);
DestroyWindow(hwnd);
- after_end_dialog = 0;
- test_def_id = 0;
+ after_end_dialog = FALSE;
+ test_def_id = FALSE;
hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_POPUP,
0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL);
}
else ok(broken(1), "infinite loop\n");
if ( i == 0)
- paint_loop_done = 1;
+ paint_loop_done = TRUE;
return DefWindowProcA(hWnd,msg,wParam,lParam);
}
}
trace("start scroll\n");
ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL,
SW_ERASE|SW_INVALIDATE);
- ok_sequence(WmEmptySeq, "ScrollWindowEx", 0);
+ ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE);
trace("end scroll\n");
flush_sequence();
flush_events();
- ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", 0);
+ ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE);
flush_events();
flush_sequence();
/* Now without the SW_ERASE flag */
trace("start scroll\n");
ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL, SW_INVALIDATE);
- ok_sequence(WmEmptySeq, "ScrollWindowEx", 0);
+ ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE);
trace("end scroll\n");
flush_sequence();
flush_events();
- ok_sequence(ScrollWindowPaint2, "ScrollWindowEx", 0);
+ ok_sequence(ScrollWindowPaint2, "ScrollWindowEx", FALSE);
flush_events();
flush_sequence();
trace("end scroll\n");
flush_sequence();
flush_events();
- ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", 0);
+ ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE);
flush_events();
flush_sequence();
trace("end scroll\n");
flush_sequence();
flush_events();
- ok_sequence(ScrollWindowPaint1, "ScrollWindow", 0);
+ ok_sequence(ScrollWindowPaint1, "ScrollWindow", FALSE);
ok(DestroyWindow(hchild), "failed to destroy window\n");
ok(DestroyWindow(hwnd), "failed to destroy window\n");
ret = DestroyWindow(parent);
ok( ret, "DestroyWindow() error %d\n", GetLastError());
test_DestroyWindow_flag = FALSE;
- ok_sequence(destroy_window_with_children, "destroy window with children", 0);
+ ok_sequence(destroy_window_with_children, "destroy window with children", FALSE);
ok(!IsWindow(parent), "parent still exists\n");
ok(!IsWindow(child1), "child1 still exists\n");
{
MSG msg;
DWORD time;
- BOOL ret;
- int go = 0;
+ BOOL ret, go = FALSE;
time = GetTickCount();
while (GetTickCount() - time < 200 && !go) {
SetMenu(hwnd, hmenu);
SetForegroundWindow( hwnd );
+ flush_events();
set_menu_style(hmenu, MNS_NOTIFYBYPOS);
style = get_menu_style(hmenu);
{
HWND hwnd;
- paint_loop_done = 0;
+ paint_loop_done = FALSE;
hwnd = CreateWindowExA(0x0,"PaintLoopWindowClass",
"PaintLoopWindowClass",WS_OVERLAPPEDWINDOW,
100, 100, 100, 100, 0, 0, 0, NULL );
{
HWND hwnd;
MSG msg;
- int gotwmquit = FALSE;
+ BOOL gotwmquit = FALSE;
hwnd = CreateWindowExA(0, "static", "test_defwndproc", WS_POPUP, 0,0,0,0,0,0,0, NULL);
assert(hwnd);
DefWindowProcA( hwnd, WM_ENDSESSION, 1, 0);
if( msg.message == WM_QUIT) gotwmquit = TRUE;
DispatchMessageA( &msg );
}
- ok( gotwmquit == FALSE, "Unexpected WM_QUIT message!\n");
+ ok(!gotwmquit, "Unexpected WM_QUIT message!\n");
DestroyWindow( hwnd);
}
return;
}
+ InitializeCriticalSection( &sequence_cs );
init_procs();
hModuleImm32 = LoadLibraryA("imm32.dll");
test_winevents();
/* Fix message sequences before removing 4 lines below */
-#if 1
if (pUnhookWinEvent && hEvent_hook)
{
ret = pUnhookWinEvent(hEvent_hook);
pUnhookWinEvent = 0;
}
hEvent_hook = 0;
-#endif
test_SetFocus();
test_SetParent();
test_combobox_messages();
test_wmime_keydown_message();
test_paint_messages();
-// test_interthread_messages(); ReactOS ActivateActCtx seems to be broken.
+ if(!winetest_interactive)
+ skip("ReactOS ActivateActCtx seems to be broken.\n");
+ else
+ test_interthread_messages();
test_message_conversion();
test_accelerators();
test_timers();
GetLastError() == 0xdeadbeef, /* Win9x */
"unexpected error %d\n", GetLastError());
}
+ DeleteCriticalSection( &sequence_cs );
}