Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const EM_REPLACESEL = &HC2
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Check1_Click()
If Check1.Value = 1 Then
Text4.Visible = True
ElseIf Check1.Value = 0 Then
Text4.Visible = False
End If
End Sub
Private Sub Command1_Click()
Text1.Text = ""
Text1.SetFocus
Dim S As String
Dim i, j As Integer
j = Val(Text2.Text)
S = Text3.Text
For i = 1 To Len(S)
Select Case Mid(S, i, 1)
Case "0"
Call Command2_Click
Sleep 500
Case "1"
Call Command3_Click
Sleep 500
Case "a"
Call keybd_event(9, 0, 0, 0) '按下
Call keybd_event(9, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "b"
Call keybd_event(13, 0, 0, 0) '按下
Call keybd_event(13, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "c"
Call keybd_event(19, 0, 0, 0) '按下
Call keybd_event(19, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "d"
Call keybd_event(27, 0, 0, 0) '按下
Call keybd_event(27, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "e"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(65, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(65, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "f"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(67, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(67, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "g"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(86, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(86, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "h"
Call keybd_event(18, 0, 0, 0) '按下
Call keybd_event(9, 0, 0, 0) '按下
Call keybd_event(18, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(9, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "i"
Call keybd_event(18, 0, 0, 0) '按下
Call keybd_event(19, 0, 0, 0) '按下
Call keybd_event(78, 0, 0, 0) '按下
Call keybd_event(18, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(19, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(78, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "j"
Call keybd_event(18, 0, 0, 0) '按下
Call keybd_event(19, 0, 0, 0) '按下
Call keybd_event(88, 0, 0, 0) '按下
Call keybd_event(18, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(19, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(88, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "k"
Call keybd_event(112, 0, 0, 0) '按下
Call keybd_event(112, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "l"
Call keybd_event(113, 0, 0, 0) '按下
Call keybd_event(113, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "m"
Call keybd_event(114, 0, 0, 0) '按下
Call keybd_event(114, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "n"
Call keybd_event(115, 0, 0, 0) '按下
Call keybd_event(115, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "o"
Call keybd_event(116, 0, 0, 0) '按下
Call keybd_event(116, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "p"
Call keybd_event(117, 0, 0, 0) '按下
Call keybd_event(117, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "q"
Call keybd_event(118, 0, 0, 0) '按下
Call keybd_event(118, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "r"
Call keybd_event(119, 0, 0, 0) '按下
Call keybd_event(119, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "s"
Call keybd_event(120, 0, 0, 0) '按下
Call keybd_event(120, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "t"
Call keybd_event(121, 0, 0, 0) '按下
Call keybd_event(121, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "u"
Call keybd_event(122, 0, 0, 0) '按下
Call keybd_event(122, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "v"
Call keybd_event(123, 0, 0, 0) '按下
Call keybd_event(123, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "w"
Call keybd_event(8, 0, 0, 0) '按下
Call keybd_event(8, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "x"
Call keybd_event(36, 0, 0, 0) '按下
Call keybd_event(36, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "y"
Call keybd_event(35, 0, 0, 0) '按下
Call keybd_event(35, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "z"
Call keybd_event(18, 0, 0, 0) '按下
Call keybd_event(20, 0, 0, 0) '按下
Call keybd_event(18, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(20, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "A"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(16, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(16, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "B"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(88, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(88, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "C"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(68, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(68, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "D"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(78, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(78, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "E"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(79, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(79, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "F"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(19, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(19, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "G"
Call keybd_event(10, 0, 0, 0) '按下
Call keybd_event(68, 0, 0, 0) '按下
Call keybd_event(10, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(68, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "H"
Call keybd_event(10, 0, 0, 0) '按下
Call keybd_event(69, 0, 0, 0) '按下
Call keybd_event(10, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(69, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "I"
Call keybd_event(10, 0, 0, 0) '按下
Call keybd_event(77, 0, 0, 0) '按下
Call keybd_event(10, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(77, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "J"
Call keybd_event(10, 0, 0, 0) '按下
Call keybd_event(82, 0, 0, 0) '按下
Call keybd_event(10, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(82, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "K"
Call keybd_event(16, 0, 0, 0) '按下
Call keybd_event(9, 0, 0, 0) '按下
Call keybd_event(16, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(9, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "L"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(9, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(9, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "M"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(16, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(16, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "N"
Call keybd_event(12, 0, 0, 0) '按下
Call keybd_event(115, 0, 0, 0) '按下
Call keybd_event(12, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(115, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "O"
Call keybd_event(12, 0, 0, 0) '按下
Call keybd_event(13, 0, 0, 0) '按下
Call keybd_event(12, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(13, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "P"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(27, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(27, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "Q"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(12, 0, 0, 0) '按下
Call keybd_event(46, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(12, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(46, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "R"
Call keybd_event(16, 0, 0, 0) '按下
Call keybd_event(46, 0, 0, 0) '按下
Call keybd_event(16, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(46, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "S"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(83, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(83, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "T"
Call keybd_event(16, 0, 0, 0) '按下
Call keybd_event(121, 0, 0, 0) '按下
Call keybd_event(16, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(121, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "U"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(115, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(115, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "V"
Call keybd_event(12, 0, 0, 0) '按下
Call keybd_event(19, 0, 0, 0) '按下
Call keybd_event(12, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(19, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "W"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(87, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(87, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "X"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(90, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(90, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "Y"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(89, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(89, 0, KEYEVENTF_KEYUP, 0) '释放
Sleep j
Case "Z"
Call keybd_event(17, 0, 0, 0) '按下
Call keybd_event(122, 0, 0, 0) '按下
Call keybd_event(17, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(122, 0, KEYEVENTF_KEYUP, 0) '释放
End Select
Next
End Sub
Private Sub Command2_Click()
Dim S As String
S = Text1.Text
Shell S, vbNormalFocus
End Sub
Private Sub Command3_Click()
Dim S As String
S = Text5.Text
Shell S, vbNormalFocus
End Sub
Private Sub Command4_Click()
Call keybd_event(vbKeyCapital, 0, 0, 0) '模拟按下 'vbKeyCapital=20
Call keybd_event(20, 0, &H2, 0) '模拟弹起键
Call keybd_event(9, 0, 0, 0) '按下
Call keybd_event(9, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(13, 0, 0, 0) '按下
Call keybd_event(13, 0, KEYEVENTF_KEYUP, 0) '释放
Call keybd_event(vbKeyTab, 0, 0, 0) '模拟按下
Call keybd_event(9, 0, &H2, 0) '模拟弹起键
Call keybd_event(vbKeyA, 0, 0, 0) '模拟按下
Call keybd_event(65, 0, &H2, 0) '模拟弹起键
End Sub
Private Sub Form_Load()
Text4.Visible = False
End Sub
联系客服