注册 登录
编程论坛 VB6论坛

VB 模拟WIN键怎么没有反应呢 代码如下

dawn4640576 发布于 2013-04-26 15:57, 649 次点击
Option Explicit
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYEVENTF_KEYUP = &H2
Private Const KEYEVENTF_EXTENDEDKEY = &H1
Private Const VK_LWIN = &H5B '左WIN键
Private Const VK_RWIN = &H5C '右WIN键

Private Sub Form_Load()
keybd_event VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY, 0 ' 按下
keybd_event VK_LWIN, 0, KEYEVENTF_KEYUP, 0 ' 弹起
End Sub
高手们看看问题出在哪?
3 回复
#2
lowxiong2013-04-26 16:17
我xp系统用的正常,弹出了开始菜单。
#3
dawn46405762013-04-26 16:18
那就怪了,我的怎么不行呢,缺少什么东西,还是有冲突?
#4
dawn46405762013-04-26 16:27
我是在vmvare虚机里测试的,这样不行?
1