VB如何模拟按键
OptionExplicitPrivateDeclareFunctionPostMessageLib"user32"Alias"PostMessageA"(ByValhw...
Option Explicit
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_KEYDOWN = &H100
Private Const WM_KEYUP = &H101
Private Sub Command1_Click()
Dim hwd As Long
hwd = 1574346
PostMessage hwd, WM_KEYDOWN, vbKeyReturn, 0 '向目标句柄发送回车键
PostMessage hwd, WM_KEYUP, vbKeyReturn, 0
End Sub
请问如何在此基础上 能发送1健 2健后F1 F2 等
在线等
请问如何在此基础上能发送1健 2健 或F1 F2 等 展开
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_KEYDOWN = &H100
Private Const WM_KEYUP = &H101
Private Sub Command1_Click()
Dim hwd As Long
hwd = 1574346
PostMessage hwd, WM_KEYDOWN, vbKeyReturn, 0 '向目标句柄发送回车键
PostMessage hwd, WM_KEYUP, vbKeyReturn, 0
End Sub
请问如何在此基础上 能发送1健 2健后F1 F2 等
在线等
请问如何在此基础上能发送1健 2健 或F1 F2 等 展开
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
Private Const WM_KEY1 =&H31
Private Const WM_KEY2 ==&H32
Private Const WM_KEYF1 ==&H70
Private Const WM_KEYF2 = =&H71
Private Const WM_KEY2 ==&H32
Private Const WM_KEYF1 ==&H70
Private Const WM_KEYF2 = =&H71
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
使用sendkeys函数。
sendkeys "a"'按a
sendkeys "+a"'按Shift+a
sendkeys "^a"'Ctrl+a
sendkeys "%a"'Alt+a
sendkeys "{Enter}"'回车
sendkeys "abcdef"'按顺序输入
sendkeys "a"'按a
sendkeys "+a"'按Shift+a
sendkeys "^a"'Ctrl+a
sendkeys "%a"'Alt+a
sendkeys "{Enter}"'回车
sendkeys "abcdef"'按顺序输入
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
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 键
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 键
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询