I was wondering how can I read text of a control that doesn’t have an HWND. For instance, the print dialog in office 2007 doesn’t have HWND on all of its controls (only a few).
Is there anyway to get the text from these controls?
I believe they’re simply drawn on the window and react using HITTEST, but I’m not sure, so I’m asking you guys :-).
Thanks for your help!
Generally, there is no guaranteed way to do that. However, chances are you can get the text (and other info about the controls) using the IAccessible interface. Most Microsoft products implement this interface on most of the UI elements: this is how screen readers for disabled people work