Emulate keyboard
How can I emulate keyboard in application running in background (hidden in tray). I want to press, hold, and relase keys on keyboard programatically. Also, I would like to开发者_如何学C move mouse around and be able to click.
You can use SendInput API function
You can also try the Windows.Forms.SendKeys API
Here is a How-To: How to: Simulate Mouse and Keyboard Events in Code
精彩评论