Nikolay Sivov (@nsivov) commented about dlls/wshom.ocx/shell.c:
+ DWORD othertid = GetWindowThreadProcessId(hWnd, &pid); + BOOL attached = AttachThreadInput(mytid, othertid, TRUE); + SetForegroundWindow(hWndTarget); + V_VT(&vTmp) = VT_EMPTY; + if (Wait && !is_optional_argument(Wait) && + SUCCEEDED(VariantChangeType(&vTmp, Wait, 0, VT_BOOL)) && V_BOOL(&vTmp)) + { + UINT wait = 2000, interval = 100; + for (; wait && GetForegroundWindow() != hWndTarget; wait -= interval) + Sleep(interval); + } + SetLastError(0); + hr = (SetFocus(hWndTarget) || !GetLastError()) ? S_OK : S_FALSE; + if (attached) + AttachThreadInput(mytid, othertid, FALSE); + } This looks very specific. Where do those checks come from?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/11157#note_143144