PDA

View Full Version : Solved: Getwindowstext and settext



pototoj
03-03-2013, 12:54 PM
Hi I would like to have some help to understand this process. I have read alot about it, but still not managed to make it work. I would like if some could be so kind, to upload a working sample how this work. I am a littel stock in this have read so much, but what ever i try, it dont seems to work. I have also tried with visual basic 6.
So below there is a form. I know how to make it in an internet explorer form. But here i would like to have it, like its a local application, which means it have to use the windows handle for the form and fill out the fields. Thats the hold idea. Please if some could have a look at the filed form i upload and attach a working code in an excel sheet, its would really be great. Then i could work with that code, to better understand it and also edit in it. Please have a look.
Thanks
Really hope for some who know how to do this.

Pototoj

Kenneth Hobs
03-04-2013, 02:42 PM
Use the Internet Explorer object model and make your life easier.

http://www.vbaexpress.com/forum/showthread.php?t=34422

pototoj
03-04-2013, 09:47 PM
HI Kenneth and thank you for the answer. I think maybe i did not explain it correct, sorry for that. I know more or less how to do it, when we are talking about a webpage.And also there is example programs like roboform, which is really great for that. So maybe my uploaded file was not an good example. What i need is a working solution for, when the form is not a webpage. So when its a form in some kind of other program. I think i know what can be done, but also i dont know how to do that. I have seen some of your exelent threads and i think you know quite alot of this. I think i need to find that window by its title for the form. And then find all the specific controls for that window. When it have found them, it shall paste a text in every control(field) in the fields. how the come up in order. And if that text can come from excel cell A1 and down so every cell display a text for the specific control, it would be perfect. And in the same time i need to save the configuration. So i can use it again.
I am quite sure of this can be done, and alot written about it. But never after much search been able to find any working solution for this.
So if you have time i would be greatfull if you can help with this.
Please have a look

Thank you

Potj.

Kenneth Hobs
03-05-2013, 07:20 AM
I don't see a way to do it with API methods per se. If API methods would work, then how the form is used is important. That determines the parent window that you need. You can then iterate some child windows and such.

When working with API methods, my first tool is the API-Guide. http://allapi.mentalis.org/agnet/apiguide.shtml

My second tool for such things is a free API spy program. It is the 2nd link from the bottom. http://patorjk.com/blog/software/

Start your form and then use the API spy. It can generate some vb code that could help you. The tool has several features.

pototoj
03-05-2013, 07:43 AM
Thanks Kennet. Just took a short look at this and its sound good for sure. Some reading and learning, and i also like the spy. So thanks allot for the help. Will mark this as solved for now. Think i have to read some more about it. So thanks allot. Have a nice day

Potj