Results 1 to 4 of 4

Thread: Finding text boxes on remote programs

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Posts
    30

    Finding text boxes on remote programs

    We use an app at work called "Remedy" and it is for data logging. I am writing a program to automatically fill in the blanks with common information by using appactivate and sendkeys to type and tab between fields. Just wondering if it is possible to have my app actually find a field, then put the text there rather than tabbing blindly through and sending keys to the app.

    Another Q i have, whenever Remedy loses focus, and you activate it by clicking on it on the task bar, there seems to be no way th get the cursor to show up unless you click on a field. However, when that specific windo is opened, the cursor is by default in the top field. I guess if i can make my app find the fields, that would also resolve this problem, but in the meantime, I have to click on the first field after appactivate brings remedy to the front, then use my app to input data.

  2. #2
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    1) U could use Spyxx.exe, a tool thats installed along with Visual Studio, find out the captions/handles of all the fields of that app, and use those handles along with the "SendMessage" API Call with the "SETTEXT" parameter, to set the text of thoses fields.

    2) To make it generic, U could iterate thru the child windows of the parent application, and retrieve each child's handle and then set its text.

    As the API Calls involved are various and quite complicated, I'd suggest visiting http://www.allapi.net to get their API-Guide and view their samples. Also send a Private Message or Email member Duncan (Merrion/MerrionComputing) for assistance. He should be able to help U.

    HTH

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Posts
    30
    Wow, that is some good info there. I will see what I can do with that. Thanks a lot.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Posts
    30
    I am experimenting with this on notepad, and have a question. I can get the hWnd of the notpad window by using the enumwindow function and finding the hWnd of the window by comparing a partial string to the enumerated window titles to find the right window. (catch that?) So I can find that hWnd, but how would I find the hWnd of the edit box in notepad? If I use Spy++, that gives it to me, but I need the program to be able to find these handles automatically because they seem to constantly change. Any thoughts?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width