VB怎么让一个程序后台运行,需要时可以呼出?

2025-02-24 02:11:01
推荐回答(2个)
回答1:

给你说个简单好用的办法把
'1添加一个Timer时间控件

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
'申明api

Private Function MyHotKey(vKeyCode) As Boolean
MyHotKey = ((GetAsyncKeyState(vKeyCode) < 0))
End Function

Private Sub Form_Load()
Timer1.Interval = 100 '定时检测
Me.Visible = False
End Sub

Private Sub Timer1_Timer()
If MyHotKey(vbKeyO) Then Me.Visible = True
'还可以换成调用其他函数
End Sub

回答2:

百度搜热键