Nikolay Sivov (@nsivov) commented about dlls/user32/tests/msg.c:
- };
- hwnd = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
100, 100, 200, 200, 0, 0, 0, NULL);
- ok(hwnd != 0, "Failed to create parent window\n");
- for (type = BS_PUSHBUTTON; type <= BS_DEFCOMMANDLINK; ++type)
- {
if (type != BS_RADIOBUTTON && type != BS_AUTORADIOBUTTON)
continue;
style = type | WS_CHILD | WS_VISIBLE | BS_NOTIFY;
button = CreateWindowExA(0, WC_BUTTONA, "test", style, 0, 0, 50, 14, hwnd, (HMENU)ID_BUTTON, 0, NULL);
ok(button != NULL, "failed to create a button, 0x%08lx, %p\n", style, hwnd);
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
It makes sense to have a helper for this.