Results 1 to 6 of 6

Thread: Get other application's content/text...

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    43

    Get other application's content/text...

    I am doing a program that needs to know the content of other window application. For example, if use ShellExecute to call Norton to scan a file, I want to know the result of the scanning. This can only be done if I can get the content of the Norton window. What can I do to 'retrieves' the content?
    Or can I know the text/string on any button on Norton's window?
    Please guide...

    Thanks a lot on any help offers....
    Ben Chin

  2. #2
    jim mcnamara
    Guest
    This is the outline:
    1. run Norton (or whatever)
    2. invoke Spy++ to find out what type of window or control it is you want to access
    3. Use SendMessage() api to request information from the control.
    There are other api's to use as well - like GetWindowText.
    It depends on what type of window it is, and what data you want.

    IF you go to www.allapi.net and look in the article section, you will find several articles on using SendMessage to request data from various boxes , controls, & windows.

    This isn't very specific, but your description is likewise vague.

  3. #3
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    Jim is right...

    The only thing I will add to it is that in order to use sendmessage, you must first know the handle to the window. This can be obtained through the use of FindWindow(classname, caption). You can use the classname and vbnullstring for the caption, vbnullstring for the classname and the text of the caption, or the proper values for both classname and caption. This will return a value to a parent window. Then you need to use FindWindowEx to get the handles to the child windows(or controls). Once you have the handle to the proper child, you can use sendmessage with the 2nd parameter being wm_gettext. If you need me to elaborate further, just ask.

    Joe

  4. #4

    Thread Starter
    Member
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    43
    I've tried the spy stuff (downloaded) but it can't works... it works well with other windows but not with this Norton windows..
    i am thinking of using sendmessage but how do i send "alt + e" by sendmessage?
    please guide... thanks..
    Ben Chin

  5. #5
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    I don't quite get it...

    Are you using the right click simulation of scanning a file(i.e. right click: scan this file with Norton AntiVirus)? If you are, a dialog box pops up that you can easily get the text of. Actually, I just looked now, everything you need to get to is easily accessible. Do you need more help with how to use spy++? If so I would be glad to help.

    Joe

  6. #6

    Thread Starter
    Member
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    43

    Wink

    Yes, it is the simulation of scan this file with Norton (right click). I need to know the result of the scanning.. if it contains virus or no. So, I need to know the text/content of it. I've never use Spy++ before. Do I need to include it in my program for distribution or anything.. Thanks so much for ur help. I really appreciate it.
    Ben Chin

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