PDA

View Full Version : Need to bring Qt application to foreground called from win32 application



umen
7th May 2011, 09:23
Hello i have simple win32 application that uses the createProcess method to call Qt application the problem is i like to bring the Qt application to the foreground . who is responsible for this ? the parent win32 app or the Qt application ?

rsilva
7th May 2011, 13:30
Look at the CreateProcess (CreateProcess Function (http://msdn.microsoft.com/en-us/library/ms682425(v=vs.85).aspx)) this param: LPSTARTUPINFO lpStartupInfo. STARTUPINFO.

There's a field to set how the window will show, WORD wShowWindow;

You can use the same values that you can use in the ShowWindow Function (http://msdn.microsoft.com/en-us/library/ms633548(v=vs.85).aspx).

I think if you use this SW_SHOWNORMAL it will work.

pavanbarot
4th October 2011, 13:39
Try this it might be helps you.

this->stackUnder(parentWidget()); [this means your QMainwindow]

woodtluk
5th October 2011, 16:45
Not a answer but some hints:

One application of mine is minimzed to the tray. To bring it to the front again I use this code:


showMinimized(); // This is to bring up the window if not minimized
// but beneath some other window
setWindowState(Qt::WindowActive);
showNormal();


I've got this code from sowhere but can't remember where. So tribut to the unknown guy who posted it in the wast land of the iternet...