按键精灵的按键效果用VB怎么实现`? 250分哦

2024-12-29 06:55:58
推荐回答(6个)
回答1:

全是我一个人写的哦!我是老K.
-----------
ReturnValue2 =Shell("一个程序.exe", 1)
AppActivate ReturnValue2, True
激活那个程序

SendKeys "{TAB 2}", True
向那个程序发送TAB键2次

不断的用sendkeys就行了,模拟键盘操作.MSDN有sendkeys的"发招表":P
可用定时器或者多媒体计时器进行延时调节.
------------
下面是 kav2005时代算号器自动按键的程序之Form1内容.因为自己使用所以没做更多调节.用过就过去了,呵呵.是开了个记事本记录算号器里隔三跳一的有效序列号.
-----------
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 8895
ClientLeft = 60
ClientTop = 345
ClientWidth = 5640
LinkTopic = "Form1"
ScaleHeight = 8895
ScaleWidth = 5640
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "Command2"
Height = 615
Left = 4680
TabIndex = 3
Top = 2520
Width = 855
End
Begin VB.TextBox Text2
Height = 495
Left = 4800
TabIndex = 2
Text = "Text2"
Top = 1320
Width = 735
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 4800
TabIndex = 0
Top = 360
Width = 735
End
Begin VB.TextBox Text1
Height = 5655
Left = 0
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 1
Text = "Form1.frx":0000
Top = 0
Width = 4575
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public al As String
Private Sub Command1_Click()
'2005-03-26 02:52 完成并让其开始工作.
'金山毒霸6注册机连续输出
'由于用了虚拟机的增强部分,现在连这里(主机,真机器)的剪贴板都跟着虚拟机走了,呵呵,贴出来的都是那边的.不知道
'是否会影响速度.

Dim ReturnValue, ReturnValue2
ReturnValue2 = Shell("a.exe", 1)
AppActivate ReturnValue2, True

SendKeys "{TAB 2}", True
For pp = 1 To 100
For I = 1 To 50
Clipboard.Clear

SendKeys "{ENTER}", True
SendKeys "{TAB 2}", True

For k = 1 To 3
SendKeys "{ENTER}", True
SendKeys "{TAB 2}", True
SendKeys "^c", True
al = al & Clipboard.GetText & Chr(13) & Chr(10)

SendKeys "{TAB 1}", True
SendKeys "^c", True
al = al & Clipboard.GetText & Chr(13) & Chr(10)

SendKeys "{TAB 2}", True
SendKeys "^c", True
al = al & Clipboard.GetText & Chr(13) & Chr(10) & Chr(13) & Chr(10)

SendKeys "{TAB 1}", True
100 DoEvents
Next k
SendKeys "{TAB 4}", True
Next I
Text1 = al
pp1 = Str(pp) & ".txt"
Open pp1 For Output As #1
Print #1, al
Close
al = ""
Text2 = pp
Next pp
End Sub

Private Sub Command2_Click()
End
End Sub

回答2:

哈哈 同上

回答3:

urduidrur

回答4:

呵呵,上面的人有点强啊!!!
我支持啊~!

回答5:

sdfdfsafsafds

回答6:

lihai