But why? It shouldn't. I find it very useful that Trolltech offered some insight on how QtSingleApplication was implemented. Once you had this information, the Internet is full of documentation on FindWindow and WM_COPYDATA, and the other methods used on the other platforms.
bunjee (13th February 2008)
Right,
I'll take a look and I'll post my home-made implementation.
And guess what ? It'll be free.
Anybody knows where can I get first parameter for FindWindow function? It is registered window class name and I don't know how to obtain it![]()
C++ & AMD forever
Just as docs say, use RegisterClass(). If title is enough, you can do:
Qt Code:
WId QxtWindowSystem::findWindow(const QString& title) { std::wstring str = title.toStdWString(); return ::FindWindow(NULL, str.c_str()); }To copy to clipboard, switch view to plain text mode
J-P Nurmi
It's funny today I've asked two questions and 5 minutes after I've found a solution myself
But I suppose that hardcoding window name is not the best idea...
I've done it like this
But anyway thanks jpnQt Code:
wchar_t *str = new wchar_t[16]; mbstowcs(str,"My Window Title", 16 ); qDebug()<<"------------------------------------"; qDebug()<<FindWindow(0, str); qDebug()<<"------------------------------------";To copy to clipboard, switch view to plain text mode![]()
C++ & AMD forever
Does anybody know how to implement run once application on Mac OS X ? In the docs on QSingleApplication I've read that they use "named ports". Anyone knows what is it ? Some links would be very useful...![]()
C++ & AMD forever
Bookmarks