I've got two applications I'm developing using Qt on windows. I want the user to be able to press a button in one application which makes the other application come to the foreground. (The programs communicate using QLocalSocket / named pipes)
Currently I'm using Qt's QWidget::activateWindow() which occasionally brings the application to the foreground but most of the time it just highlights the program on the taskbar.
Can someone please tell me how to do this, preferebly using Qt although failing that using the WIN32 API would be fine.
Unfortunately I couldn't find a way to do this only with Qt. I solved it using Chris Becke's suggestion of calling SetForegroundWindow from the currently active application.