I am using Qt to build a screenshot program.
The question is:
How to obtain the window handle below the mouse cursor? Firstly, I created a full-screen Qt widget to display the fullscreen screenshot. When I move the mouse cursor, how to obtain the handle of window under the cursor? Of course, the full-screen Qt widget should be ignored.
I tried to use win32 API, such as WindowFromPointEx()
by filtering the windows with WS_EX_LAYERED
attribute. However, I cannot set Qt widget as WS_EX_LAYERED
attribute.
What should I do to obtain the handle of the window?