Filling external Edit fields with text
Posted on 2003-10-29
"Lazyness is the mother of 9 out of 10 inventions"...
A friend of mine ;-) has his internet access blocked by a firewall that from time to time asks for a username and a password. Since he is a very good friend of mine I would like to help him by making a program that continuosly scans the desktop windows and when it finds the login window fills automatically the two edit fields and then simulates pressing the OK button.
The window has "Network password" as caption. The window class it's a misterious name: #32770. The two edits have the class names "Edit". Apart from these two edits there are also 2 buttons (OK+Cancel) and a check box ("Remember username and password". It doesn't remember...)
So far I've been able to find the window's handle and the classes of the two edits (for the latter I used an external program). How can I find the handle of the two edits? How can I then press the OK button?