Rémi Bernon (@rbernon) commented about dlls/user32/tests/input.c:
- ok( ret, "CreateProcess "%s" failed err %lu.\n", path, GetLastError() );
- empty_message_queue();
- hwnd = CreateWindowA( "static", "static", WS_VISIBLE | WS_POPUP, 100, 100, 100, 100, 0, NULL, NULL, NULL );
- ok( hwnd != 0, "CreateWindow failed\n" );
- SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)append_message_wndproc );
- p_accept_message = accept_keyboard_messages_raw;
- empty_message_queue();
- /* FIXME: Try to workaround X11/Win32 focus inconsistencies and
* make the window visible and foreground as hard as possible. */
- ShowWindow( hwnd, SW_SHOW );
- SetWindowPos( hwnd, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE );
- SetForegroundWindow( hwnd );
- UpdateWindow( hwnd );
- empty_message_queue();
I'm happy to see tests but fwiw playing with focus is the best way to create spuriously failing tests, especially with Wine having all sorts of related race conditions.
I started changing these tests to use `create_foreground_window` instead of these hacks, although I didn't do it for all the tests as I wanted to see how it was going. I think it's more reliable, and it gives a meaningful failure when it fails to get the window foreground.
Then still I'm not sure it's worth adding more cross process tests, especially as dispatching is already better and more reliably tested in `dinput`. If the only purpose is to exhibit NOLEGACY being checked in the target process, I think we can just assume that it is, without adding tests.