I expect this is going to be tricky to get in. I ran into the following issues: * test_ShowWindow behaves very strangely on Windows. It seems this isn't typical behavior, and is caused by an interaction with test_SetFocus, but I'm not sure exactly what it does to the thread state that causes this. * Many of the SetWindowPos flag combinations tested don't actually show the window on Windows, therefore they don't send EVENT_SYSTEM_FOREGROUND. I was able to reproduce this with a stand-alone test, so it seems to be normal behavior. * Windows can show a window without activating it, and Wine on X11 can't do that reliably for managed windows. * There are a couple of cases where Windows sends an event and Wine doesn't. I figure it's OK to not cover every case, but I can go back and investigate those if needed.
This interacts with https://gitlab.winehq.org/wine/wine/-/merge_requests/2314, in that the tests don't really test much without it. I applied that MR for my own testing.
-- v5: win32u: Implement EVENT_SYSTEM_FOREGROUND.