A
A
armadillo-cld2020-09-21 14:18:25
C++ / C#
armadillo-cld, 2020-09-21 14:18:25

How to get the HDC of the element the cursor is on?

Hello.
I want to make animation on Win32. Made a nice interface based on dialog boxes. The borders are thin, the system buttons set their own.
The question is this: I want to make an animation when clicking / hovering or similar actions. How to trace - I know. But the question is different - how can I get the HDC of the control, which was clicked / hovered over and, in general, with which the cursor / user interacts? Checking the mouse coordinates via GetCur..Pos, and then checking it with the coordinates of the desired control is not an option.

PS: not necessarily HDC, you can just HANDLE or at least some control data, so that you can then interact with it (change color, size, etc.)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2020-09-21
@armadillo-cld

Well, since you are at such a low level, why not catch the corresponding messages in the processing loop? https://docs.microsoft.com/en-us/windows/win32/inp...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question