版主我来了 楼上的回答可行的。
又是模拟键盘问题
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Declare Function keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long) As Boolean
If GetKeyState(20) Then '//模拟Caps Lock 键
keybd_event 20, 0, 0, 0
keybd_event 20, 0, 2, 0
End If