问题
We are working on an Windows Desktop application that pulls values from other controls on other applications. What we have works great for most desktop applications. I have noticed that some controls don't show up in inspect and Spy++. For example, in GP 2015 client only a handful of the controls are addressable in Spy++ and Inspect. The large majority wont show in the repective tree in Spy++ or Inspect. What type of controls don't show in Inspect and for extra credit, how can we talk to them?
Thanks in advance, Steve
回答1:
Spy++ only works with controls that have an HWND
associated with them.
Inspect only works with controls that are exposed to UI Automation via the IAccessible, IUIAutomation, and other related interfaces.
So, any custom-made non-windowed non-automatable control will not appear in either tool. Such controls are not available to the outside world, so you cannot communicate with them, or manipulate them. Only the owning app can, since only it has knowledge of what they are and how to interact with them.
来源:https://stackoverflow.com/questions/41174895/what-type-of-controls-dont-show-up-in-spy-inspect