Click here to Skip to main content
13,593,048 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
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.
Posted 14-Jun-18 8:53am
Updated 14-Jun-18 9:04am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03-2016 | 2.8.180618.1 | Last Updated 14 Jun 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100