Below I've attached a simple code for sendkeys. I open a Notepad, then execute the code from Visual Studio 2008 (I'm using Win XP) by pressing F5. The program executes fine, and finishes without errors, but nothing is actually outputed to the Notepad. I'd appreciate anyone who can copy/paste this to their VB software and give it a quick run. Don't forget to open a Notepad first. The program will focus on the Notepad, pause for 2 second, then execute the sendkeys function, then pause for 2 seconds and END. Thanks. I've exhausted searching for answers elsewhere.




Module Module1
Public Class SendKeys
Public Shared Sub Send( _
ByVal keys As String _
)
End Sub
End Class

Sub Main()
AppActivate("Untitled - Notepad")
System.Threading.Thread.Sleep(2000)
SendKeys.Send("hello")
System.Threading.Thread.Sleep(2000)
End Sub
End Module