Results 1 to 8 of 8

Thread: VB2005- Extracting data from other application

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    449

    Exclamation VB2005- Extracting data from other application

    Hi,

    I am wondering if it is possible to extract values from various controls (such as textboxes, comboboxes) available on an application using API's?

    For example App1 is the application which has several controls such textboxes and comboboxes.

    Is is possible to write App2 (which runs seperately) that extract data available on the controls of App1?

    The purpose is for automated testing...

    Any feedback will highly appreciated..
    thanks

  2. #2
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: VB2005- Extracting data from other application

    Yes Surya,

    SendMessage api is one of the best choices to obtain the value from an external application's controlls (windows).

    But to use SendMessage, you must have some knowledge on window handles and how to obtain external application window (Main window, textbox, combobox, command button etc, are all are just windows) handles. if you can obtain the handle of the exteranal control you want to retrive the information, then you almost get it. There are many examples on the forum regarding sendmesage api and window handles. also in my signature. just give a try.

    Specially, in this api forum, there are many threads with title like "Retrive information from external application" like. so a search is what you need.

    the is another method call DDE, I have never used that.

  3. #3
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: VB2005- Extracting data from other application

    Suriya, i am sorry, i am talking about vb6, and just now i saw that your asking in vb2005 . Sorry.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    449

    Re: VB2005- Extracting data from other application

    Thank you Fazi for your response...
    I am wondering if anyone is conversant with API's for extracting data from another app..

    thanks

  5. #5
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: VB2005- Extracting data from other application

    Also dont forget to search the forum for this Topic

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    449

    Re: VB2005- Extracting data from other application

    Hi Fazi,
    With my limited knowledge in API's, I have not been able to make any progress on the project so far.

    I am wondering if you can help me with some sample code using VB6.

    thanks

  7. #7
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: VB2005- Extracting data from other application

    Hi surya,
    Can you please tell from which application you want to get data and from which control in that application ?

  8. #8
    Fanatic Member TTn's Avatar
    Join Date
    Jul 2004
    Posts
    708

    Re: VB2005- Extracting data from other application

    Yes you should be able to do this with the API.

    You can use these API:
    FindWindow
    FindWindowEx
    SendMessage
    PostMessage

    With these constant prefixes for combobox, and Edit(text):
    CB_
    I've got some examples in this thread:ComboBox

    EM_
    Edit control Messages should be similar.

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