PDA

View Full Version : QApplication focus from other friend instance



patrik08
9th June 2008, 13:42
I try QApplication::setActiveWindow(this);
and other flag ...

but i can only make this and run ok.
How to make focus QApplication from linux & mac?



if(instance.isRunning())
{
#if defined Q_WS_WIN
/* focus this QApplication instance from other QApplication*/
HWND hWnd = FindWindowW( 0, (LPCWSTR) titles.utf16() );
ShowWindow( hWnd, SW_RESTORE );
SetForegroundWindow( hWnd );
#endif
/* send the file to other instance..... */