Latzi_Marian
asked on
SendKeys command doesn't work after Microsoft Update
Hi
I have written a VB6 program a while ago and it was working perfectly for years.Today I did a windows update and the program stopped working.What actually happens is that I have a routine which starts another program (Through SHELL) sets the focus on it and with SendKeys I emulated keystroke F2 which actually starts the called program.Easy enough.Obviously the update had some security stuff in it (I have no ideea which update as it took 107 updates from MS today) which kills the sendkeys.Is there any other easy way except api's to simulate a keystroke (my case "F2" key) ?
Here's the routine in question:
As I said this worked perfectly untill a few hours ago.any help would be highly appreciated.
I have written a VB6 program a while ago and it was working perfectly for years.Today I did a windows update and the program stopped working.What actually happens is that I have a routine which starts another program (Through SHELL) sets the focus on it and with SendKeys I emulated keystroke F2 which actually starts the called program.Easy enough.Obviously the update had some security stuff in it (I have no ideea which update as it took 107 updates from MS today) which kills the sendkeys.Is there any other easy way except api's to simulate a keystroke (my case "F2" key) ?
Here's the routine in question:
As I said this worked perfectly untill a few hours ago.any help would be highly appreciated.
Private Sub Response_B1()
Dim pHandle As Long
Dim ITask As Long
Form1.TxtSayit.Text = "Now Starting 3G internet connection "
currCall.ISpeak.Speak TxtSayit.Text
ITask = Shell("C:\Program Files\3 Mobile\3 Mobile Broadband\3 Mobile Broadband.exe", vbNormalFocus)
pHandle = OpenProcess(SYNCHRONIZE, 0, ITask)
If (pHandle <> 0) Then
WaitForSingleObject pHandle, 30000
CloseHandle pHandle
End If
SendKeys "{F2}"
Form1.TxtSayit.Text = "3g connection has been started to retrieve the IP address press 8 "
currCall.ISpeak.Speak TxtSayit.Text
'Form1.Text6.Text = LocalIPAddresses("+")
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome. De nada!!!
Saludos.
FerG
--
Ing. Fernando D. Giletta
San Fco. Cba. Arg.
Saludos.
FerG
--
Ing. Fernando D. Giletta
San Fco. Cba. Arg.
ASKER