PDA

View Full Version : setFocus to the same but already running application !?



hakermania
11th November 2010, 16:57
The application on the constructor checks if the program is already running and then it outputs a QMessageBox and the the program exits. I would prefer to make it focus on the already running application of the same program!
How can I do this? I 've search a lot about setFocus but I wasn't able to find something!

Timoteo
12th November 2010, 01:29
You'll have to get your hands dirty with some platform-specific code. Since you already know the title(s) of your window(s), enumerating them and setting focus should be fairly straightforward.

Look here (http://msdn.microsoft.com/en-us/library/ms633497(VS.85).aspx) and here (http://msdn.microsoft.com/en-us/library/ms633499(VS.85).aspx) for something to get you started on Windows.