找回密码
 加入
搜索
查看: 1864|回复: 2

[AU3基础] 想用DllCll 得到USB键盘的句柄 ,不知道怎么写、、

[复制链接]
发表于 2012-5-29 01:26:11 | 显示全部楼层 |阅读模式
想用DllCll 得到USB键盘的句柄 ,不知道怎么写

PS2 键盘的

如下
Global $DDD_RAW_TARGET_PATH = 1


Global $DDD_REMOVE_DEFINITION = 2


Global $KEYBOARD_INDICATOR_PARAMETERS="ushort UnitId;ushort LedFlags;"


Global $IOCTL_KEYBOARD_SET_INDICATORS = 720904


Global $IOCTL_KEYBOARD_QUERY_INDICATORS = 720960


 


; Flags to _KeyboardSetLed


Global $KEYBOARD_LIT = 0


Global $KEYBOARD_UNLIT = 8


Global $KEYBOARD_SCROLL_LED = 1


Global $KEYBOARD_NUM_LED= 2


Global $KEYBOARD_CAPS_LED = 4


 


; #FUNCTION# ====================================================================================================================


; Name...........: _OpenKeyboard


; Description ...: Opens a handle to the keyboard


; Syntax.........: _OpenKeyboard()


; Parameters ....: None


; Return values .: None


; Author ........: Andreas Karlsson (monoceres)


; Modified.......:


; Remarks .......:


; Related .......: _CloseKeyboard


; Link ..........;


; Example .......; Yes


; ===============================================================================================================================


Func _OpenKeyboard()


        Local $KeyboardHandle


        DllCall("Kernel32.dll","int","DefineDosDeviceW","dword",$DDD_RAW_TARGET_PATH,"wstr","Keybd","wstr","\Device\KeyboardClass0")


        $KeyboardHandle = DllCall("Kernel32.dll","hwnd","CreateFile","str","\\.\Keybd","dword",0x40000000,"dword",0,"dword",0,"dword",3,"dword",0,"dword",0)


        $KeyboardHandle=$KeyboardHandle[0]


        Return $KeyboardHandle


EndFunc
详细请移步

http://www.autoitx.com/forum.php ... =%BC%FC%C5%CC%B5%C6
 楼主| 发表于 2012-5-29 20:30:33 | 显示全部楼层
没有人指导一下吗 ??
 楼主| 发表于 2012-5-29 21:08:25 | 显示全部楼层
没人搞的定吗
想知道 搜索了很久了 没有答案
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 01:00 , Processed in 0.412442 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表