Hello,
I'm trying to send the "F9" key to windows as if it was typed on the
keyboard.
I'm using the following code:
Dim p As System.Diagnostics.Process
If
System.Diagnostics.Process.GetProcessesByName("ShekelPC.exe").Count =
1 Then
For Each p In
System.Diagnostics.Process.GetProcessesByName("ShekelPC.exe")
AppActivate(p.Id)
My.Computer.Keyboard.SendKeys("{F9}", True)
Next
End If
End
After trying only:
My.Computer.Keyboard.SendKeys("{F9}", True)
didn't help much.
I'm trying to get "ShekelPC.exe" which sits in the background (in the
system tray) to capture that "F9" keypress.
It's like a hotkey for that application and I'm having a hard time
managing to send that simple command to the system automatically
instead of physically pressing it.
Why isn't my code working?
If the key is sent as if pressed then the application should react as
it normally does.
Is there another, better way of doing this?
Thanks
Oren