Rémi Bernon (@rbernon) commented about dlls/user32/tests/win.c:
+ BOOL ret; + MSG msg; + + cls.lpfnWndProc = message_window_topmost_proc; + cls.hInstance = GetModuleHandleW(NULL); + cls.lpszClassName = L"test_message_window_topmost"; + atom = RegisterClassW(&cls); + ok(!!atom, "Cannot register window class\n"); + + hwnd = CreateWindowW(L"test_message_window_topmost", L"main window", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 210, 211, 212, 213, NULL, NULL, GetModuleHandleW(NULL), NULL); + ok(!!hwnd, "Cannot create main window\n"); + + hwnd_msg = CreateWindowW(L"test_message_window_topmost", L"message window", 0, + 220, 221, 222, 223, HWND_MESSAGE, NULL, GetModuleHandleW(NULL), NULL); + ok(!!hwnd_msg, "Cannot create message window\n"); What about doing this instead?
```suggestion:-6+0 hwnd = CreateWindowW(L"static", L"main window", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 210, 211, 212, 213, NULL, NULL, GetModuleHandleW(NULL), NULL); ok(!!hwnd, "Cannot create main window\n"); flush_events(TRUE); SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)message_window_topmost_proc); hwnd_msg = CreateWindowW(L"static", L"message window", 0, 220, 221, 222, 223, HWND_MESSAGE, NULL, GetModuleHandleW(NULL), NULL); ok(!!hwnd_msg, "Cannot create message window\n"); flush_events(TRUE); SetWindowLongPtrW(hwnd_msg, GWLP_WNDPROC, (LONG_PTR)message_window_topmost_proc); ``` Then you wouldn't need a custom window class, or to workaround winex11 events (they should have been flushed before changing the window proc). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/419#note_77978