<p>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 and named pipes.)</p>

<p>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.</p>

<p>Can someone please tell me how to do this, preferably using Qt although failing that using the WIN32 API would be fine.</p>

<hr>

<p>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.</p>

On top of the
```
QWidget::activateWindow
```
method, you should call
```
QWidget::raise
```
!
This is what is said
here
.