2

Are there any tutorials or guides out there that anyone knows of that will show me how to read forms from an external program and get back information about the controls on the form? Currently, I can get the handle to the form, and I can get the class name, but I need to get more information such as a persistent name and contained data. Thanks.

Edit:

I now have a way to read the contained data (with the WM_GETTEXT message), however, I still need a persistent name/ID that I can be sure will not change from instance to instance. One way I can think of for doing this is to take the handle, find the position of the control on the window, and then get the handle from the position from then on. Another way is to determine a static ID for the control and then use that to get the handle from then on. The new scope of my problem is how to implement either of these. Any Ideas?

James McNellis
  • 348,265
  • 75
  • 913
  • 977
Tom A
  • 1,662
  • 2
  • 23
  • 41
  • Is this external program under your control, or is this an arbitrary 3rd party program? I ask because WM_GETTEXT doesn't always work on 3rd party controls. – Eric Brown Mar 27 '10 at 08:01
  • It'll be third party. I'm not too worried about it working or not as the third party controls it will read are either text boxes or labels – Tom A Mar 29 '10 at 14:49

1 Answers1

0

I would look at UI Automation; in particular, the RuntimeID property, the NativeWindowHandle property, and the Name property.

Eric Brown
  • 13,774
  • 7
  • 30
  • 71