I was working on an UI automation project recently and I had to submit key press messages to a windows forms application. I was looking at ways of writing code to make that possible, but then I found that you can actually just call SendKeys.Send() to send any key press message to the active form. Who knew it could be so easy.
http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx