When I run the following code, I get a message pertaining to the
ProcessID variable stating "ArgumentException was Unhandled",
of course the keys do not get sent to the Calculator.
(This snippet was copied directly from MS Help -Keyboard SendKeys Method.)
Any help is appreciated.
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim ProcessID As Integer
ProcessID = Shell("Calc.exe", AppWinStyle.NormalFocus)
AppActivate(ProcessID)
My.Computer.Keyboard.SendKeys("22", True)
My.Computer.Keyboard.SendKeys("*", True)
My.Computer.Keyboard.SendKeys("2", True)
My.Computer.Keyboard.SendKeys("=", True)
End Sub
End Class
ProcessID variable stating "ArgumentException was Unhandled",
of course the keys do not get sent to the Calculator.
(This snippet was copied directly from MS Help -Keyboard SendKeys Method.)
Any help is appreciated.
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim ProcessID As Integer
ProcessID = Shell("Calc.exe", AppWinStyle.NormalFocus)
AppActivate(ProcessID)
My.Computer.Keyboard.SendKeys("22", True)
My.Computer.Keyboard.SendKeys("*", True)
My.Computer.Keyboard.SendKeys("2", True)
My.Computer.Keyboard.SendKeys("=", True)
End Sub
End Class