admin 管理员组

文章数量: 887021

vbKeyLButton0x1鼠标左键vbKeyRButton0x2鼠标右键vbKeyCancel0x3CANCEL键vbKeyMButton0x4鼠标中键vbKeyBack0x8退格键vbKeyTab0x9TAB键vbKeyClear0xCCLEAR健vbKeyReturn0xD回车键vbKey…展开
 我来答 分享 举报
1个回答
wangaochao1980
推荐于2016-04-16 · TA获得超过449个赞

Keycode 常数
可在代码中的任何地方用下列常数代替实际值:
常数 值 描述
vbKeyLButton 0x1 鼠标左键
vbKeyRButton 0x2 鼠标右键
vbKeyCancel 0x3 CANCEL 键
vbKeyMButton 0x4 鼠标中键
vbKeyBack 0x8 BACKSPACE 键
vbKeyTab 0x9 TAB 键
vbKeyClear 0xC CLEAR 键
vbKeyReturn 0xD ENTER 键
vbKeyShift 0x10 SHIFT 键
vbKeyControl 0x11 CTRL 键
vbKeyMenu 0x12 MENU 键
vbKeyPause 0x13 PAUSE 键
vbKeyCapital 0x14 CAPS LOCK 键
vbKeyEscape 0x1B ESC 键
vbKeySpace 0x20 SPACEBAR 键
vbKeyPageUp 0x21 PAGE UP 键
vbKeyPageDown 0x22 PAGE DOWN 键
vbKeyEnd 0x23 END 键
vbKeyHome 0x24 HOME 键
vbKeyLeft 0x25 LEFT ARROW 键
vbKeyUp 0x26 UP ARROW 键
vbKeyRight 0x27 RIGHT ARROW 键
vbKeyDown 0x28 DOWN ARROW 键
vbKeySelect 0x29 SELECT 键
vbKeyPrint 0x2A PRINT SCREEN 键
vbKeyExecute 0x2B EXECUTE 键
vbKeySnapshot 0x2C SNAPSHOT 键
vbKeyInsert 0x2D INSERT 键
vbKeyDelete 0x2E DELETE 键
vbKeyHelp 0x2F HELP 键
vbKeyNumlock 0x90 NUM LOCK 键
A 至 Z 键与 A – Z 字母的 ASCII 码相同:
常数 值 描述
vbKeyA 65 A 键
vbKeyB 66 B 键
vbKeyC 67 C 键
vbKeyD 68 D 键
vbKeyE 69 E 键
vbKeyF 70 F 键
vbKeyG 71 G 键
vbKeyH 72 H 键
vbKeyI 73 I 键
vbKeyJ 74 J 键
vbKeyK 75 K 键
vbKeyL 76 L 键
vbKeyM 77 M 键
vbKeyN 78 N 键
vbKeyO 79 O 键
vbKeyP 80 P 键
vbKeyQ 81 Q 键
vbKeyR 82 R 键
vbKeyS 83 S 键
vbKeyT 84 T 键
vbKeyU 85 U 键
vbKeyV 86 V 键
vbKeyW 87 W 键
vbKeyX 88 X 键
vbKeyY 89 Y 键
vbKeyZ 90 Z 键
0 至 9 键与数字 0 – 9 的 ASCII 码相同:
常数 值 描述
vbKey0 48 0 键
vbKey1 49 1 键
vbKey2 50 2 键
vbKey3 51 3 键
vbKey4 52 4 键
vbKey5 53 5 键
vbKey6 54 6 键
vbKey7 55 7 键
vbKey8 56 8 键
vbKey9 57 9 键
下列常数代表数字键盘上的键:
常数 值 描述
vbKeyNumpad0 0x60 0 键
vbKeyNumpad1 0x61 1 键
vbKeyNumpad2 0x62 2 键
vbKeyNumpad3 0x63 3 键
vbKeyNumpad4 0x64 4 键
vbKeyNumpad5 0x65 5 键
vbKeyNumpad6 0x66 6 键
vbKeyNumpad7 0x67 7 键
vbKeyNumpad8 0x68 8 键
vbKeyNumpad9 0x69 9 键
vbKeyMultiply 0x6A MULTIPLICATION SIGN (*) 键
vbKeyAdd 0x6B PLUS SIGN (+) 键
vbKeySeparator 0x6C ENTER 键
vbKeySubtract 0x6D MINUS SIGN (–) 键
vbKeyDecimal 0x6E DECIMAL POINT (.) 键
vbKeyDivide 0x6F DIVISION SIGN (/) 键
下列常数代表功能键:
常数 值 描述
vbKeyF1 0x70 F1 键
vbKeyF2 0x71 F2 键
vbKeyF3 0x72 F3 键
vbKeyF4 0x73 F4 键
vbKeyF5 0x74 F5 键
vbKeyF6 0x75 F6 键
vbKeyF7 0x76 F7 键
vbKeyF8 0x77 F8 键
vbKeyF9 0x78 F9 键
vbKeyF10 0x79 F10 键
vbKeyF11 0x7A F11 键
vbKeyF12 0x7B F12 键
vbKeyF13 0x7C F13 键
vbKeyF14 0x7D F14 键
vbKeyF15 0x7E F15 键
vbKeyF16 0x7F F16 键
本回答被提问者采纳

VB全局热键(快捷键)

VisualBasic编程源码

'窗体代码:
Private Declare Function GetActiveWindow Lib “user32” () As Long
Private Declare Function GetAsyncKeyState Lib “user32” (ByVal vKey As Long) As Integer

Private Sub Form_Load()
Me.KeyPreview = True
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'如果窗体失去焦点,热键无效
If GetActiveWindow <> Me.hwnd Then Exit Sub
'Esc退出程序
If GetAsyncKeyState(vbKeyEscape) Then KeyCode = 0: End
'F12最大化窗口
If GetAsyncKeyState(vbKeyF12) Then KeyCode = 0: Me.WindowState = 2
'F1窗口最小化
If GetAsyncKeyState(vbKeyF1) Then KeyCode = 0: Me.WindowState = 1
End Sub
'-------------------------------------------------------------------------------------------------------------------------
'相应的VB键码
常数------------------------------值-------------描述
vbKeyLButton-----------------[1]-------------鼠标左键
vbKeyRButton-----------------[2]-------------鼠标右键
vbKeyCancel-------------------[3]-------------CANCEL 键
vbKeyMButton-----------------[4]-------------鼠标中键
vbKeyBack---------------------[8]--------------BACKSPACE 键
vbKeyTab-----------------------[9]--------------TAB 键
vbKeyClear--------------------[12]-------------CLEAR 键
vbKeyReturn------------------[13]-------------ENTER 键
vbKeyShift---------------------[16]-------------SHIFT 键
vbKeyControl-----------------[17]-------------CTRL 键
vbKeyMenu-------------------[18]-------------Alt 菜单键
vbKeyPause------------------[19]-------------PAUSE 键
vbKeyCapital-----------------[20]-------------CAPS LOCK 键
vbKeyEscape-----------------[27]-------------ESC 键
vbKeySpace------------------[32]-------------SPACEBAR 键
vbKeyPageUp----------------[33]-------------PAGEUP 键
vbKeyPageDown------------[34]-------------PAGEDOWN 键
vbKeyEnd---------------------[35]-------------END 键
vbKeyHome------------------[36]-------------HOME 键
vbKeyLeft---------------------[37]-------------LEFT ARROW 键
vbKeyUp----------------------[38]-------------UP ARROW 键
vbKeyRight-------------------[39]-------------RIGHT ARROW 键
vbKeyDown------------------[40]-------------DOWN ARROW 键
vbKeySelect-----------------[41]-------------SELECT 键
vbKeyPrint-------------------[42]-------------PRINT SCREEN 键
vbKeyExecute--------------[43]--------------EXECUTE 键
vbKeySnapshot------------[44]--------------SNAP SHOT 键
vbKeyInser------------------[45]--------------INS 键
vbKeyDelete----------------[46]--------------DEL 键
vbKeyHelp------------------[47]---------------HELP 键
vbKeyNumlock------------[144]-------------NUM LOCK 键

A 键到 Z 键与其 ASCII 码的相应值 'A ’ 到 'Z ’ 是一致的
常数--------------------------值----------------------描述
vbKeyA---------------------[65]---------------------A 键
vbKeyB---------------------[66]---------------------B 键
vbKeyC---------------------[67]---------------------C 键
vbKeyD---------------------[68]---------------------D 键
vbKeyE---------------------[69]---------------------E 键
vbKeyF---------------------[70]---------------------F 键
vbKeyG---------------------[71]---------------------G 键
vbKeyH---------------------[72]---------------------H 键
vbKeyI-----------------------[73]---------------------I 键
vbKeyJ----------------------[74]---------------------J 键
vbKeyK----------------------[75]---------------------K 键
vbKeyL----------------------[76]---------------------L 键
vbKeyM---------------------[77]---------------------M 键
vbKeyN---------------------[78]---------------------N 键
vbKeyO---------------------[79]---------------------O 键
vbKeyP---------------------[80]---------------------P 键
vbKeyQ---------------------[81]---------------------Q 键
vbKeyR---------------------[82]---------------------R 键
vbKeyS---------------------[83]---------------------S 键
vbKeyT---------------------[84]---------------------T 键
vbKeyU---------------------[85]---------------------U 键
vbKeyV---------------------[86]---------------------V 键
vbKeyW---------------------[87]---------------------W 键
vbKeyX---------------------[88]---------------------X 键
vbKeyY---------------------[89]---------------------Y 键
vbKeyZ---------------------[90]---------------------Z 键

0 键到 9 键与其 ASCII 码的相应值 '0 ’ 到 '9 ’ 是一致的
常数------------------值------描述
vbKey0-------------[48]-----0 键
vbKey1-------------[49]-----1 键
vbKey2-------------[50]-----2 键
vbKey3-------------[51]-----3 键
vbKey4-------------[52]-----4 键
vbKey5-------------[53]-----5 键
vbKey6-------------[54]-----6 键
vbKey7-------------[55]-----7 键
vbKey8-------------[56]-----8 键
vbKey9-------------[57]-----9 键

数字小键盘上的键
常数------------------------值------------描述
vbKeyNumpad0--------[96]----------0 键
vbKeyNumpad1--------[97]----------1 键
vbKeyNumpad2--------[98]----------2 键
vbKeyNumpad3--------[99]----------3 键
vbKeyNumpad4--------[100]--------4 键
vbKeyNumpad5--------[101]--------5 键
vbKeyNumpad6--------[102]--------6 键
vbKeyNumpad7--------[103]--------7 键
vbKeyNumpad8--------[104]--------8 键
vbKeyNumpad9--------[105]--------9 键
vbKeyMultiply-----------[106]-------乘号 (*) 键
vbKeyAdd----------------[107]-------加号 (+) 键
vbKeySeparator--------[108]-------ENTER 键(在数字小键盘上)
vbKeySubtract----------[109]-------减号 (-) 键
vbKeyDecimal----------[110]-------小数点 (.) 键
vbKeyDivide------------[111]--------除号 (/) 键

功能键
常数---------------值--------------描述
vbKeyF1--------[112]------------F1 键
vbKeyF2--------[113]------------F2 键
vbKeyF3--------[114]------------F3 键
vbKeyF4--------[115]------------F4 键
vbKeyF5--------[116]------------F5 键
vbKeyF6--------[117]------------F6 键
vbKeyF7--------[118]------------F7 键
vbKeyF8--------[119]------------F8 键
vbKeyF9--------[120]------------F9 键
vbKeyF10------[121]------------F10 键
vbKeyF11------[122]------------F11 键
vbKeyF12------[123]------------F12 键
vbKeyF13------[124]------------F13 键
vbKeyF14------[125]------------F14 键
vbKeyF15------[126]------------F15 键
vbKeyF16------[127]------------F16 键

a是tab切换焦点和切换控件,

b是enter换行或进入或确定,
c是 空格,
d是Esc是取消或停止或关闭,
e是CTRL+A即^A是全选,
f是CTRL+C即^C是复制,
g是CTRL+V即^V是粘贴,

h是Alt+tab即%{tab}是切换窗口,
Alt+++tab即%+{tab}是切换上一个窗口,

i是alt+空格+N是最小化窗口,
j是alt+空格+X是最大化窗口,
k是F1是显示帮助,
l是F2是重命名文件,
m是F3是查找或搜索,
n是F4是另存为或“地址”栏列表,
o是F5是刷新,
p是F6是在窗口或桌面上循环切换子菜单,
q是F7是DoS下专用功能,
r是F8是Windows 启动选项,
s是F9是Excel 中计算公式,
t是F10是激活菜单栏,
u是F11是切换全屏,
v是F12是Word 里另存文档,
w是BackSpace是删除左侧一个字符或返回上一页,
x是Home是移至行首,
y是End是移至行尾,
z是win是打开开始菜单,
A是DELETE是删除右侧一个字符,
B是CTRL+X即^X是剪切,
C是CTRL+D即^D是删除,
D是CTRL+N即^N是新建,
E是CTRL+O即^O是打开,
F是CTRL+空格是中英文输入切换
G是win+D是显示桌面,
H是win+E是打开资源管理器,
I是win+M是最小化所有窗口,
J是win+R是运行,

win+i是设置.

K是Shift+tab是在选项之间向后移动,
L是Ctrl + Tab是切换到下一选项卡,
M是CTRL+Shift即CTRL+Shift是输入法切换,
N是ALT+F4是关闭当前文件或者关闭计算机,
O是ALT+Enter是打开文件属性,
P是CTRL+Esc即^{Esc}是开始菜单,
Q是CTRL+ALT+DELETE是打开任务管理器,
R是SHIFT+DELETE是永久删除所选项,
S是CTRL+S即^S是保存文档,
T是SHIFT+F10是选中文件的右菜单或显示所选项的快捷菜单,
U是CTRL+F4即^{F4}是关闭当前窗口,
V是ALT+空格键是显示程序"控制"菜单,
W是Ctrl+W是关闭文档,
X是CTRL+Z即^Z是撤销,
Y是CTRL+Y即^Y是恢复,
Z是CTRL+F11即^{F11}是隐藏或显示菜单栏。

Declare Sub keybd_event Lib “user32” Alias “keybd_event” (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)

Public Const KEYEVENTF_KEYUP As Integer = &H2
Public Const VK_CONTROL As Byte = &H11
Public Const VK_A As Byte = &H41
Public Const VK_DELETE As Byte = &H2E
Public Const VK_V As Byte = &H56

Imports System.IO
Imports System.Runtime.InteropServices

Public Class Form1

Declare Sub keybd_event Lib “user32” Alias “keybd_event” (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)

Public Const KEYEVENTF_KEYUP As Integer = &H2
Public Const VK_CONTROL As Byte = &H11
Public Const VK_A As Byte = &H41
Public Const VK_DELETE As Byte = &H2E
Public Const VK_V As Byte = &H56






Private filePath As String ' 文本文件路径
Private lines As List(Of String) ' 读取的文本文件内容
Private currentIndex As Integer ' 当前选定的行数



Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load

    ' 设置文本文件路径
    filePath = "C:\Users\Administrator\Desktop\按键密码恢复程序源代码ZQ2023-11-16-11-21\a.txt"

End Sub


Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click


    Dim a

   

    '使用ALT+TAB进行窗口切换
    Call keybd_event(18, 0, 0, 0) '模拟按下 'vbKeyCapital=18
    ' 按下Tab切换控件
    Call keybd_event(9, 0, 0, 0) '模拟按下 'vbKeyCapital=9
    Call keybd_event(9, 0, &H2, 0) '模拟弹起键
    Call keybd_event(18, 0, &H2, 0) '模拟弹起键

    '等待一段时间,确保程序已经成功打开
    Threading.Thread.Sleep(500)



    ' 按下Tab切换控件
    Call keybd_event(9, 0, 0, 0) '模拟按下 'vbKeyCapital=9
    Call keybd_event(9, 0, &H2, 0) '模拟弹起键

    ' 按下Tab切换控件
    Call keybd_event(9, 0, 0, 0) '模拟按下 'vbKeyCapital=9
    Call keybd_event(9, 0, &H2, 0) '模拟弹起键
    '等待一段时间,确保程序已经成功打开
    Threading.Thread.Sleep(500)




    Button4.PerformClick() '复制按钮



    '按下Ctrl+V粘贴
    Call keybd_event(17, 0, 0, 0) '模拟按下 'ctrl
    Call keybd_event(86, 0, 0, 0) '模拟按下 'ctrl
    Call keybd_event(86, 0, &H2, 0) '模拟弹起键
    Call keybd_event(17, 0, &H2, 0) '模拟弹起键
    '等待一段时间,确保程序已经成功打开
    Threading.Thread.Sleep(500)




    ' 按下Tab切换控件
    Call keybd_event(9, 0, 0, 0) '模拟按下 'vbKeyCapital=9
    Call keybd_event(9, 0, &H2, 0) '模拟弹起键
    '等待一段时间,确保程序已经成功打开
    Threading.Thread.Sleep(500)




    Call keybd_event(13, 0, 0, 0) '模拟按下 'vbKeyCapital=13
    Call keybd_event(13, 0, &H2, 0) '模拟弹起键
    '等待一段时间,确保程序已经成功打开
    Threading.Thread.Sleep(500)


    Call keybd_event(13, 0, 0, 0) '模拟按下 'vbKeyCapital=13
    Call keybd_event(13, 0, &H2, 0) '模拟弹起键
    '等待一段时间,确保程序已经成功打开
    Threading.Thread.Sleep(500)


    For a = 0 To 34


        ' 按下Tab切换控件
        Call keybd_event(9, 0, 0, 0) '模拟按下 'vbKeyCapital=9
        Call keybd_event(9, 0, &H2, 0) '模拟弹起键

        ' 按下Tab切换控件
        Call keybd_event(9, 0, 0, 0) '模拟按下 'vbKeyCapital=9
        Call keybd_event(9, 0, &H2, 0) '模拟弹起键
        '等待一段时间,确保程序已经成功打开
        Threading.Thread.Sleep(500)



        Button4.PerformClick() '复制按钮





        ' 按下BACKSPACE 键5次
        Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
        Call keybd_event(8, 0, &H2, 0) '模拟弹起键

        Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
        Call keybd_event(8, 0, &H2, 0) '模拟弹起键

        Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
        Call keybd_event(8, 0, &H2, 0) '模拟弹起键

        Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
        Call keybd_event(8, 0, &H2, 0) '模拟弹起键

        Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
        Call keybd_event(8, 0, &H2, 0) '模拟弹起键

        '等待一段时间,确保程序已经成功打开
        Threading.Thread.Sleep(500)



        '按下Ctrl+V粘贴
        Call keybd_event(17, 0, 0, 0) '模拟按下 'ctrl
        Call keybd_event(86, 0, 0, 0) '模拟按下 'V
        Call keybd_event(86, 0, &H2, 0) '模拟弹起键
        Call keybd_event(17, 0, &H2, 0) '模拟弹起键
        '等待一段时间,确保程序已经成功打开
        Threading.Thread.Sleep(500)




        ' 按下Tab切换控件
        Call keybd_event(9, 0, 0, 0) '模拟按下 'vbKeyCapital=9
        Call keybd_event(9, 0, &H2, 0) '模拟弹起键
        '等待一段时间,确保程序已经成功打开
        Threading.Thread.Sleep(500)



        Call keybd_event(13, 0, 0, 0) '模拟按下 'vbKeyCapital=13
        Call keybd_event(13, 0, &H2, 0) '模拟弹起键
        '等待一段时间,确保程序已经成功打开
        Threading.Thread.Sleep(500)


        Call keybd_event(13, 0, 0, 0) '模拟按下 'vbKeyCapital=13
        Call keybd_event(13, 0, &H2, 0) '模拟弹起键
        '等待一段时间,确保程序已经成功打开
        Threading.Thread.Sleep(500)

    Next
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
    ' 如果是第一次点击按钮,读取文本文件内容并初始化 currentIndex 为 0
    If currentIndex = 0 Then
        ' 读取文本文件内容
        lines = ReadLinesFromFile(filePath)

        currentIndex = 1
    End If

    ' 检查 lines 列表是否为空
    If lines IsNot Nothing AndAlso lines.Count > 0 Then
        ' 将 lines(currentIndexa - 1) 对应的一行内容复制到剪贴板,并选定该行
        Clipboard.SetText(lines(currentIndex - 1))

        ' 将 currentIndex 加 1,如果越界则重置为 1
        currentIndex += 1
        If currentIndex > lines.Count Then
            currentIndex = 1
        End If
    End If
End Sub

Private Function ReadLinesFromFile(ByVal filePath As String) As List(Of String)
    Dim lines As New List(Of String)

    Using reader As New StreamReader(filePath)
        While Not reader.EndOfStream
            ' 读取一行内容并删除换行符
            Dim line As String = reader.ReadLine().Replace(vbCrLf, "")
            lines.Add(line)
        End While
    End Using

    Return lines
End Function

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Dim strings() As String = {"0", "a", "b", "5", "红", "绿"} ' 定义字符串数组,可根据实际情况修改数组内容

    Using writer As StreamWriter = New StreamWriter("a.txt")
        For i As Integer = 0 To strings.Length - 1 ' 循环遍历字符串数组的每个元素
            For j As Integer = 0 To strings.Length - 1 ' 循环遍历字符串数组的每个元素
                writer.WriteLine(strings(i) & strings(j)) ' 将排列结果写入到文本文件中
            Next
        Next
    End Using

    MessageBox.Show("排列组合结果已输出到a.txt文件。")
End Sub

End Class

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

’ 按下Tab切换控件
Call keybd_event(9, 0, 0, 0) '模拟按下 'vbKeyCapital=9
Call keybd_event(9, 0, &H2, 0) '模拟弹起键
'等待一段时间,确保程序已经成功打开
Threading.Thread.Sleep(500)

’ 按下BACKSPACE 键
Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
Call keybd_event(8, 0, &H2, 0) '模拟弹起键
'等待一段时间,确保程序已经成功打开
Threading.Thread.Sleep(500)

’ 按下BACKSPACE 键5次
Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
Call keybd_event(8, 0, &H2, 0) '模拟弹起键

    Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
    Call keybd_event(8, 0, &H2, 0) '模拟弹起键

    Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
    Call keybd_event(8, 0, &H2, 0) '模拟弹起键

    Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
    Call keybd_event(8, 0, &H2, 0) '模拟弹起键

    Call keybd_event(8, 0, 0, 0) '模拟按下 'vbKeyCapital=8
    Call keybd_event(8, 0, &H2, 0) '模拟弹起键

            '等待一段时间,确保程序已经成功打开
    Threading.Thread.Sleep(500)

’ 按下Ctrl+C复制
Call keybd_event(17, 0, 0, 0) '模拟按下 'ctrl
Call keybd_event(67, 0, 0, 0) '模拟按下 'ctrl
Call keybd_event(67, 0, &H2, 0) '模拟弹起键
Call keybd_event(17, 0, &H2, 0) '模拟弹起键
'等待一段时间,确保程序已经成功打开
Threading.Thread.Sleep(500)

'按下Ctrl+V粘贴
Call keybd_event(17, 0, 0, 0) '模拟按下 'ctrl
Call keybd_event(86, 0, 0, 0) '模拟按下 'ctrl
Call keybd_event(86, 0, &H2, 0) '模拟弹起键
Call keybd_event(17, 0, &H2, 0) '模拟弹起键
'等待一段时间,确保程序已经成功打开
Threading.Thread.Sleep(500)

    Call keybd_event(16, 0, 0, 0) '模拟按下 'vbKeyCapital=16
    Call keybd_event(16, 0, &H2, 0) '模拟弹起键
            '等待一段时间,确保程序已经成功打开
    Threading.Thread.Sleep(500)



    Call keybd_event(13, 0, 0, 0) '模拟按下 'vbKeyCapital=13
    Call keybd_event(13, 0, &H2, 0) '模拟弹起键
            '等待一段时间,确保程序已经成功打开
    Threading.Thread.Sleep(500)


End Sub

End Class

本文标签: 按键 旗舰版 键盘 参数 版本