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?