All I seem to be getting via Google is the keypress event. Anyone know of a way to type something into the active control (say a textbox) using code?
All I seem to be getting via Google is the keypress event. Anyone know of a way to type something into the active control (say a textbox) using code?
In general you can just set a control's .Text property, so long as the control belongs to your own program that is.
You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.
That's the thing... it doesn't. I want to be able to type something into the next window to have focus when the program is minimized. Ever use KeePass Auto-Type feature? Thats similar to what I'm looking to achieve.
If you want to type into a textbox of an external application, I think you need to wrap FindWindow, FindWindowEx, and SendMessageA APIs as I don't believe there is a way to do it in native .net.
I think KeePass is opensource. 2.x is built using .net so I'll see how its done hopefully. I've got about a year of programming experience in .net but I'm still not very comfortable with external libraries (and I defintely know next to nothing about the Windows APIs). Where to find a good site to learn about it? I know MSDN but their documenation is more reference for someone whos done it before and needs a refresher.
Bingo! :lol:
I found a .net way of doing this thanks to KeePass most recent release notes
Its SendKeys.Send("Whatever here"), part of System.Windows.Forms
See the MSDN article if you're interested.