Click to See Complete Forum and Search --> : Start EXE file


SAKYA
August 11th, 2001, 03:20 AM
I have an executable VB file that i want to start on the press of a certain function key or may be a combination of keys.Is that possible? If yes then how?Thanks in advance for any reply.

deghost
August 11th, 2001, 02:30 PM
private Sub Form_KeyPress(KeyAscii as Integer)
If KeyAscii = vbKeyA then
Call Shell("c:\MyApp.exe")
End If
End Sub




----------
The @host is everywhere!
----------

HanneSThEGreaT
August 11th, 2001, 06:17 PM
You can also do it like this:
private Sub Form_KeyPress(KeyAscii as Integer)
If KeyAscii = vbKeyA then
call winexec("c:\MyApp.exe",1)
End If
End Sub


But then you'll have to add the Winexec API function in General Declarations




F. T. W.