How to find what control is under the mouse pointer

  • Thread starter Thread starter Oleg
  • Start date Start date
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
 
Oleg,
You can use either the .NET method Control.GetChildAtPoint or the Win32
API functions WindowFromPoint/ChildWindowFromPoint.

- Marcus
 
Back
Top