6

I've done a bit of looking around and found various bits and pieces relating to this, but nothing concrete.

I need to find a method of extracting UI elements other than that of the Spy++ tool. I'm able to locate screen items and their underlying text captions based on HWND, however 3rd party apps such as Firefox offer further problems as they only have one large window for the display. If anyone has any ideas on how to natively get screen coordinates to do an OCR or control recognition of UI elements within, say, a web page I'd love to hear from you.

Wayne Koorts
  • 10,861
  • 13
  • 46
  • 72
Rob Hay
  • 368
  • 3
  • 10
  • 1
    See this related question: http://stackoverflow.com/questions/4665045/how-to-get-the-word-under-the-cursor-in-windows –  Feb 06 '11 at 22:37
  • JDV, your comment was perfect!!! I since changed my approach and now have a fully functioning application which is able to do everything Ive been given in the spec. Thanks again for your comment. – Rob Hay Feb 17 '11 at 00:13

1 Answers1

1

If what you want programmatic access a web page as Firefox sees it, there are much better ways.

Try Watir or selenium. These are for testing web applications, and they allow you to problematically control the web browser.

Byron Whitlock
  • 52,691
  • 28
  • 123
  • 168
  • Thanks Byron, but after a bit more research I have located some useful interactions from the USER32 library that will allow me to locate and grab window information. However, the main driver of my application is the extraction of the text residing in the control (for example the form's text box inside a webpage) and the USER32 functions will only allow me to extract the title of the control or class. – Rob Hay Jan 12 '11 at 03:18