How to find what control is under the mouse pointer

O

Oleg

Hi,

Does anyone know any way to find what control is under the mouse pointer?
In my application (MDI forms application) I need to track mouse move events
and find what control is currently
under the mouse, it can be MDI child form, button, label, etc.
Maybe some Win API function which finds Handle of the object so I could
convert it to Control using FromHandle method?
Or some .NET managed method?

Thank you for the help,

Oleg
 
M

Marcus

Oleg,
You can use either the .NET method Control.GetChildAtPoint or the Win32
API functions WindowFromPoint/ChildWindowFromPoint.

- Marcus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top