想用VB实现:按F1打开“C:\我的程序.exe”,再按一次关闭它??
vb6.0吧
全部回复
仅看楼主
level 1
想用VB实现:按F1打开“C:\我的程序.exe”,再按一次关闭它,能实现吗?
求各位大神指点
2017年06月24日 02点06分 1
level 1
dim b as boolean
dim pid as long
private sub form_Keydown(KeyCode As Integer, Shift As Integer)
if KeyCode = vbkeyF1 then
b = not b
if b = true then
pid = shell ("C:\我的程序.exe")
else
shell "taskkill /PID " & pid & "/F /T"
pid = 0
end if
end if
end sub
private sub form_load()
b = false
end sub
2017年07月05日 02点07分 2
1