Is it possible to somehow check if window (on Windows) with certain title exists at the moment.. or do I need some kind of winapi magic for that?
Is it possible to somehow check if window (on Windows) with certain title exists at the moment.. or do I need some kind of winapi magic for that?
Yes, you need that winapi magic
A combination of EnumWindows() and GetWindowTitle() should do the trick.
There is a simpler way! Take a look at msdn: http://msdn.microsoft.com/en-us/library/ms633499.aspx
The FindWindow() function:
Qt Code:
HWND handle = FindWindow(NULL, "Window Title");To copy to clipboard, switch view to plain text mode
This should work for you.
PS: The function returns NULL on a non'existant window, or the window handle otherwise.
Last edited by tinsuke; 21st January 2009 at 11:30. Reason: Further explanations
Oh, thank you so much! I've been looking for this like.. forever.. too bad it can't be done with Qt but I totally understand why. But thanks again!
If you're willing to introduce a dependency to Qxt, you can use QxtWindowSystem.
J-P Nurmi
Thanks, I'll look into that
Bookmarks