Foxtable(狐表)用户栏目专家坐堂 → 求打开关闭小键盘的命令(数字键、大写键)


  共有4759人关注过本帖树形打印复制链接

主题:求打开关闭小键盘的命令(数字键、大写键)

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/7/15 15:11:00 [显示全部帖子]

 全局代码

 

Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
Public Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Integer, ByVal wMapType As Integer) As Integer

Public Const VK_NUMLOCK = &H90 ' Num Lock

Public Const KEYEVENTF_KEYDOWN = &H0 ' KeyDown

Public Const KEYEVENTF_KEYUP = &H2 ' KeyUp

 

 触发代码

 

Dim intScanCode As Integer = MapVirtualKey(VK_NUMLOCK, 0)

keybd_event(VK_NUMLOCK, intScanCode, KEYEVENTF_KEYDOWN, 0) ' 按下

keybd_event(VK_NUMLOCK, intScanCode, KEYEVENTF_KEYUP, 0) ' 放

[此贴子已经被作者于2014-7-15 15:12:13编辑过]

 回到顶部