I want to bring a window to the foreground (from another application). I am currently using:
::SetWindowPos(hwnd, GetForegroundWindow(), 0, 0, 0, 0, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
It works fine, but in some cases (unknown to me) it makes the window always on top. According to MSDN, I should use HWND_NOTOPMOST instead of GetForegroundWindow() , but it does not work - the window remains under other (not always top) windows.
How can I bring a window to the fore without activating it?
Sathoh
source share