read/enter text based on cursor position

S

supportgeek

Greetings.

Would anyone know the right direction to point me on this one?

I need to read text from a Windows Application based on cursor
position.
And enter text based on what is read.

Example:(the interface of the windows application would look something
like this.)

-----------------------------------
Windows Application X
-----------------------------------
Name:
Address:
City:
State:
Zip:
-----------------------------------

I need to scan the application for address - and put in my address,
etc...
Right now I am using sendkeys (win32::GuiTest) but it really isn't
cutting it)

The only part I need help on in this is getting the location of where
it says address, or whatever field is the case.

I was thinking it might be possible to somehow read to the left based
on cursor position. If anyone could point me in the right direction I
would appreciate it.

Thanks in Advance.

Mike
 
M

Michael A. Covington

Is there a good reason you can't put the name, address, city, state, and zip
into different text boxes to begin with?
 
G

Greg Ewing [MVP]

supportgeek, I assume you are trying to read this info out of another
application? If it's your own app then Michael's question is mine too. If
you are trying to read out of another, the "easiest" way will be to use
P/Invoke and FindWindowEx to find the Window/text box and then read the
value out of it. Is that what you're looking for?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top