VB中如何将lParam转换为键值
如题
[解决办法]
不好意思,好象lParam同时包含键值和键操作
好象lParam的倒数第3个字节就是键值,你还是作个小程序获取全部键值吧。
[解决办法]
msdn2.microsoft.com/library/ms646280.aspx - 12k
[解决办法]
ScanCode=lParam and &HFF
VirtualKey=MapVirtualKey(ScanCode,1)
ASCII=MapVirtualKey(VirtualKey,2)
这样?lparam是那里得来的?hook?setwindowlong?还是其他?
[解决办法]
参照这里:http://access911.net/ocr/doc1.asp?mode=a&bid=005101&aid=5252514
[解决办法]
对于键盘hook获得的lparam,一般是一个结构,如下
Private Type EVENTMSG
wMsg As Long
lParamL As Long
lParamH As Long
msgTime As Long
hWndMsg As Long
End Type
你可以这样得按键的ascii
dim EMSG as EVENTMSG
.....
CopyMemory EMSG, ByVal lParam, Len(EMSG)
debug.print EMSG.wMsg