keybd_event,PostMessage,SendMessage 都不能发送CTRL组合键 VB
PrivateSubCommand1_Click()DimhwndAsLonghwnd=131850BringWindowToTop(hwnd)SetForeground...
Private Sub Command1_Click()
Dim hwnd As Long
hwnd = 131850
BringWindowToTop (hwnd)
SetForegroundWindow (hwnd)
keybd_event 17, 0, 0, 0 ' press =
keybd_event 34, 0, 0, 0 ' press =
keybd_event 34, 0, KEYEVENTF_KEYUP, 0 ' release =
keybd_event 17, 0, KEYEVENTF_KEYUP, 0 ' release =
End Sub
Private Sub Command2_Click()
Dim hwnd As Long
hwnd = 131850
BringWindowToTop (hwnd)
SetForegroundWindow (hwnd)
PostMessage hwnd, WM_KEYDOWN, VK_CONTROL, &H1D0001
PostMessage hwnd, WM_KEYDOWN, VK_NEXT, 0
PostMessage hwnd, WM_KEYUP, VK_NEXT, 0
PostMessage hwnd, WM_KEYUP, VK_CONTROL, &HC01D0001 '释放Ctrl键
End Sub
Private Sub Command3_Click()
Dim hwnd As Long
hwnd = 131850
BringWindowToTop (hwnd)
SetForegroundWindow (hwnd)
SendMessage hwnd, WM_KEYDOWN, VK_CONTROL, 0
SendMessage hwnd, WM_KEYDOWN, VK_NEXT, 0
SendMessage hwnd, WM_KEYUP, VK_NEXT, 0
SendMessage hwnd, WM_KEYUP, VK_CONTROL, 0
End Sub 展开
Dim hwnd As Long
hwnd = 131850
BringWindowToTop (hwnd)
SetForegroundWindow (hwnd)
keybd_event 17, 0, 0, 0 ' press =
keybd_event 34, 0, 0, 0 ' press =
keybd_event 34, 0, KEYEVENTF_KEYUP, 0 ' release =
keybd_event 17, 0, KEYEVENTF_KEYUP, 0 ' release =
End Sub
Private Sub Command2_Click()
Dim hwnd As Long
hwnd = 131850
BringWindowToTop (hwnd)
SetForegroundWindow (hwnd)
PostMessage hwnd, WM_KEYDOWN, VK_CONTROL, &H1D0001
PostMessage hwnd, WM_KEYDOWN, VK_NEXT, 0
PostMessage hwnd, WM_KEYUP, VK_NEXT, 0
PostMessage hwnd, WM_KEYUP, VK_CONTROL, &HC01D0001 '释放Ctrl键
End Sub
Private Sub Command3_Click()
Dim hwnd As Long
hwnd = 131850
BringWindowToTop (hwnd)
SetForegroundWindow (hwnd)
SendMessage hwnd, WM_KEYDOWN, VK_CONTROL, 0
SendMessage hwnd, WM_KEYDOWN, VK_NEXT, 0
SendMessage hwnd, WM_KEYUP, VK_NEXT, 0
SendMessage hwnd, WM_KEYUP, VK_CONTROL, 0
End Sub 展开
1个回答
威孚半导体技术
2024-08-19 广告
2024-08-19 广告
威孚(苏州)半导体技术有限公司是一家专注生产、研发、销售晶圆传输设备整机模块(EFEM/SORTER)及核心零部件的高科技半导体公司。公司核心团队均拥有多年半导体行业从业经验,其中技术团队成员博士、硕士学历占比80%以上,依托丰富的软件底层...
点击进入详情页
本回答由威孚半导体技术提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询