Home > Software engineering >  How to get a handle of a label in a window
How to get a handle of a label in a window

Time:12-09

How to get a handle of a label in a window. I try spy4win and spy , they dont work. enter image description here

CodePudding user response:

If Spy cannot identify a HWND for a UI element then there isn't one. Several UI toolkits (such as Qt) use window-less controls.

Your only option in this case is to use UI Automation. It provides a framework for identifying user interface elements that doesn't rely on native windows. You can use the Inspect.exe tool to verify whether the application in question implements the required interfaces.

If the application doesn't implement the UI Automation interfaces, there's little you can do, outside of taking a screenshot and trying to identify UI elements based on pixel data, and extracting text by means of OCR.

  • Related