PDA

View Full Version : How to enumerate all top-level windows?



TorAn
19th May 2011, 00:28
I know WinAPI implementation to get the handles of all top-level windows, but is it possible to do the same thing using Qt?

My ultimate goal is that I need to send keystrokes to the 3-rd party application. So my follow-up question will be (assuming that I can get the handle to the top window Qt-way): how to send keystrokes from Qt app to another application's window?

wysota
19th May 2011, 01:13
If you know how to do it with WinAPI, why are you looking for a different solution? Qt doesn't spy on other applications.

TorAn
19th May 2011, 04:15
wysota:

The reason I am looking for Qt-way of doing it is the same reason I am doing Qt at all. The enumeration of processes, top-level windows and similar actions are generic enough to be abstracted in multi-platform solution such as Qt.

wysota
19th May 2011, 10:03
No, they are not generic at all. Windows is the only platform that allows to spy and manipulate other processes like that. Other platforms don't have such concepts.