yes it is possible. AFAIK you need P/Invoke for mouse automation, see functions SendInput and SetCursorPos in user32.dll; for keyboard automation the .NET System.Windows.Forms.SendKeys class could be sufficient. For all of them, you must make sure you are talking to the right window, which needs to have focus; so you will probably need even more P/Invoke and use functions GetForegroundWindow, SetForegroundWindow, GetWindowText, and maybe more. Warnings: 1. you probably need to include some delays, say Thread.Sleep(100), so the target application can react to your automation inputs (which otherwise would come much faster than a human user would provide them); 2. whatever you do it will not be absolutely safe. For one, there could still be a user typing/mousing around; second, target apps may suddenly throw unexpected stuff at you, maybe a dialog telling you the disk got full, the network connection was lost, etc. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.