Hello,
I was wondering how to set focus to a program but what I tried did not work. Any Ideas
And basically what I have is a typing bot, and I need the timer when it sends the message to open the specific program it needs to send the message to instead of just what usually happens (Finds the start menu and searches.) But any way here is what I tried.
Private Spammer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles timer1.Tick
'Dim hwnd As Long
'hwnd = FindWindow(vbNullString, "Microsoft Flight Simulator X")
'OpenIcon(hwnd)
'SetForegroundWindow(hwnd)
'Send(TextBox1.Text)
Dim myAppId As Object
myAppId = Shell("c:\windows\FSX\Flight Simulator X.exe", AppWinStyle.NormalFocus)
AppActivate(myAppId)
SendKeys.Send("**Robot**")
SendKeys.Send(TextBox1.Text)
SendKeys.Send("{ENTER}")
But that never Works for some reason, I Will get the error code and put it in this topic.
Any Help would be awesome. :)