96是小键盘上0的键盘码 第三个参数0是键盘按下动作,2是键盘弹起动作
友情提供:送一个小键盘数字串连续输入的方法。
Sub NumInput(num)
extern.Declare micvoid,"keybd_event","user32.dll","keybd_event",micByte,micByte,micLong,micLong
If num <> "" Then
sum = Len(num)
For i=1 To sum
num = Mid (num,i,1)
Select Case num
Case "0"
key1=96
Case "1"
key1=97
Case "2"
key1=98
Case "3"
key1=99
Case "4"
key1=100
Case "5"
key1=101
Case "6"
key1=102
Case "7"
key1=103
Case "8"
key1=104
Case "9"
key1=105
End Select
extern.keybd_event key1,0,0,0
extern.keybd_event key1,0,2,0
Next
End If
End Sub