Click to See Complete Forum and Search --> : Get other application's content/text...
benchin
Dec 27th, 2001, 09:35 AM
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....
jim mcnamara
Dec 27th, 2001, 01:49 PM
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.
Joey_k29
Dec 27th, 2001, 02:56 PM
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
benchin
Dec 28th, 2001, 02:33 AM
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.. :)
Joey_k29
Dec 30th, 2001, 10:42 AM
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
benchin
Dec 31st, 2001, 02:49 AM
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. :)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.