模拟按键WIN+R(开始-运行)

时间:2023-01-17 08:21:42

网络代码,版权归原作者所有 

 

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const VK_R = 83
Const VK_LWIN = 91
Private Sub Command1_Click()

Call keybd_event(VK_LWIN, 0, 0, 0)
Call keybd_event(vbKeyR, 0, 0, 0)
Call keybd_event(vbKeyR, 0, KEYEVENTF_KEYUP, 0)
Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
End Sub