Link to home
Start Free TrialLog in
Avatar of Latzi_Marian
Latzi_MarianFlag for Australia

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.


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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of FER_G
FER_G
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Latzi_Marian

ASKER

It's working perfectly.Gracias.
You're welcome. De nada!!!

Saludos.
FerG
--
Ing. Fernando D. Giletta
San Fco. Cba. Arg.