June 15, 2026
1:37 p.m.
On Mon Jun 15 18:11:03 2026 +0000, Nikolay Sivov wrote: > Timeout values, last error checks, case-insensitive window text check. > Is AttachThreadInput needed with SetForegroundWindow? Things like that. - AttachThreadInput is [a well-known](https://stackoverflow.com/a/3772400) hack to make SetForegroundWindow work better (stealing focus, which is actually what we legitimately want in this case because the user/script is probably going to follow up by sending keystrokes to this window). - Case-insensitive window text prefix check is easy to just verify on Windows. - The timeout values I made up, seemed about right. - `SetLastError(0)` is needed so we can tell if `SetFocus` failed (the function returns NULL) or if it succeeded but there was no previously focused window (the function returns NULL). This is documented on MSDN... -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11157#note_143152