I am trying to write a program that when run is able to put text into another programs edit boxes - like an automated questionnaire filler outer prog. I have a few progs that I constantly enter the same text into fields over and over - can someone confirm that I need to use the Windows Hooks ICZ tute to get into the other program and WM_SETTEXT its edit boxes? Or is there another simpler way? James
Hi James, I don't think you have to use the Hook's Tut. I think You must first get the handle of the window on which there are the edit boxes, then you must know the ID of the edit boxes (edit the exe file with Borland Workshop or another and look the ID) and send the text on it. E-mail me if you want, I can send you a prog I made which press the OK button (it's a loop until the window appear) on the dialog of the password of the LAN. It is in French because I don't know how it is on English version. Vom-bonjour:-()
use FindWindow to find the window and retrieve the handle of it. then use GetDlgItem to get the handle of the editbox. (you must know the ID of the window) now you know the handle of the editbox you can use WM_SETTEXT to set your wished text.. it will look something like: invoke FindWindow, NULL, addr szWindowText invoke GetDlgItem, eax, ID_WINDOW invoke SendMessage, eax, WM_SETTEXT, 0, addr szSetText if you dont know the ID of the window, you can use the Customizer or even Icz's hook tut sample to get it.
sorry bro, you can't aye, cause, seen when you send the message: i.e invoke FindWindow, NULL, addr szWindowText invoke GetDlgItem, eax, ID_WINDOW invoke SendMessage, eax, WM_SETTEXT, 0, addr szSetText Note, in the SendMessage call, the last parameter, 'addr szSetText', contains a pointer to a location in memory. Seen your app is running in Win32, the pointer is only valid in the context of your process, if the edit control is in another app, the pointer will contain the same value, but wont point to anything, i.e cause a page fault on access.
Hi, Now I 've modified the Hook tuts by Icz and I can get the ID of controls so, if you want me to send it to you, mail me. And I've also made a prog which can set text or enable or disable a control, or press a button... Vom-bonjour:-() PS:The progs are not all finished but there are the main procs.
manimal, i didnt test it when i posted my little piece of code, but after i read your reply i compiled it and ran my executable and it works fine here.. (running win2k) I used it on mIRC's registration box. also this is a really good tool (freeware) for getting properties of windows: http://www.greatis.com/windowse.htm or the customizer (shareware) is also a good tool for changing properties of a window but i forgot the url.
Hi everybody, After all the messages, I decided to make a useful prog. It has been done now. In a few days it will be posted on the Iczelion Site.(i've just send it to him). It uses the mousehook (I thank Iczelion for his tut). You can change the Caption of a control and enable or disable a control. Vom-bonjour:-() <--------------THE ASM_32 FRENCH PROGRAMMER-------------->