Is the there a way to force another window to be on top? Not the application's window, but another one, already running on the system. (Windows, C/C++/C#)
You can use the Win32 API BringWindowToTop. It takes an HWND.
You could also use the Win32 API SetWindowPos which also allows you to do things like make the window a top-level window.
SetWindowPos(that_window_handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
BringWindowToTop
moves the window to the top of the Z-order (for now) but does not make it a topmost window.
I tried this from VB6 to now C# all because the customers wanted it - nothing really works, nothing holds the window on top, just bring it up for the moment.
But anyway, why should a window be on topmost as long as it is running? I can only imagine a Teacher/Test-Software, where the user should not be able to open up a browser and query google for answers. In such a case I recommend to capture the whole screen, or react on losing the focus/mouse.
BringWindowToTop() has no effect if you want to bring a applications window from behind (or minimized) to front. The following code does this trick reliable:
ShowWindow(hwnd, SW_MINIMIZE);
ShowWindow(hwnd, SW_RESTORE);