Thanks for replying, that worked but only inside the program, I added a rich textbox inside the program to test it and it worked. However if I press F9 and then put the cursor on a notepad or any text box outside the program it doesn't write anything like I wanted to. Do you know what I could be doing wrong?

Re: How to use a Key to automatically press Enter and enter text?

Posted 24 October 2012 - 03:38 AM

Ok, I played a little with this, and here is something, you can start working on. Just make a new Windows Form project, and paste all the code in it. You'll get the feeling how to send keys around (I hope):

Re: How to use a Key to automatically press Enter and enter text?

Posted 24 October 2012 - 03:17 PM

Thanks for all your help guys, but after researching on this I found out a simpler way to do this by using Global Hotkeys and calling the user32.dll library. After reading some tutorials about global hotkeys I was able to google a simpler way to do this. Here's my code after I called the user32.dll file: