Writing to text fields

How do you create a C++ program that writes into text fields, for example: A program that when it runs writes an already preset string to a textfield outside of the program itself (Like a password textbox). The reason that I am doing this is so I could log on to my mail quickly on my computer and I have my computer supervised at all times so nobody could copy the program.
You need to emulate kypresses: http://msdn.microsoft.com/en-us/library/ms171548.aspx
Also you can use KeePass programm to store and enter passwords with simple keypress (I set it to Ctrl+Alt+E)
Wow, that was really quick! Thanks!
One problem, I get Error C1190 when I try to run the example code

fatal error C1190: managed targeted code requires a '/clr' option
Fixed thanks
Topic archived. No new replies allowed.