I am using AutomationElement in Visual Studio (Visual Basic) to access the control over which the mouse cursor is. I hooked the mouse and can get the mouse position, the windows handle and the element of the control and with this, the control name, position, size, class etc. In some cases I get the container, not the actual buttom.
Is it possible, with the data I have, to get the control itself? I need the name, position and size.
With many controls I can get what I need. Cancel button for instance. But, for example, when I click the yellow logoff button I get the complete tool bar. The exact same thing happens when I click on other tool bar buttons like the green continue button.
(I apologize for my broken English)
What I have tried:
Windows AutomationElement and in some cases I get only the container where the button or control is in.
I am using functions like AutomationElement.FromPoint to get the element.