Pergunta

Developing a specialized screen recorder application to grab data where there should be API's and there are not; I have gotten to the point where I can record button clicks and basic control contents (textboxes, labels, radio buttons, and so forth) using the Win32 API's.

Now, there is a special situation involving GridView and ListView (details view) controls in a .NET WinForms app. These are populated with data that scrolls beyond the visibility of the scroll bar.

If I can identify the type of control, is there a way to scrape its data, perhaps through Accessibility or something better?

Foi útil?

Solução

All standard Windows control implement the interfaces required for UI Automation. UI Automation allows to control a UI or query a UI for structure and content.

The Content View is a subset of the control view. It contains UI items that convey the true information in a user interface, including UI items that can receive keyboard focus and some text that is not a label on a UI item. For example, the values in a drop-down combo box will appear in the content view.

The Content View is available by searching for elements that have the IsContentElement property set to true, or by using the ContentViewWalker to navigate the tree.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top