“自动点击按钮”小工具VB源码
“自动点击按钮”小工具VB源码
Option Explicit
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
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private Sub Form_Load()
On Error Resume Next '遇错处理
Me.Hide
Dim AppPath$
AppPath = IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\") '程序路径
ChDrive Left(AppPath, 2) '切换磁盘
ChDir AppPath '切换路径
iniFileName = AppPath & "AutoClick.ini" '配置文件
If Dir(iniFileName) = "" Then
MsgBox "请在AutoClick.ini中配置信息!"
Unload Me
End If
Dim WinTitle As String
Dim ButTitle As String
Dim WinClass As String
Dim ButClass As String
Dim GameRuns As String
Dim WaitTime%
Dim WinHwnd As Long
Dim ButHwnd As Long
WinTitle = GetIniS("Config", "WinTitle", "")
ButTitle = GetIniS("Config", "ButTitle", "")
WinClass = GetIniS("Config", "WinClass", "")
ButClass = GetIniS("Config", "ButClass", "")
GameRuns = GetIniS("Config", "GameRuns", "")
WaitTime = Val(GetIniS("Config", "WaitTime", "10"))
If WinTitle = "" Then Unload Me
If ButTitle = "" Then Unload Me
If WinClass = "" Then WinClass = vbNullString
If ButClass = "" Then ButClass = vbNullString
If GameRuns <> "" Then Shell "cmd /c Start """" """ & GameRuns & """", 0
If WaitTime < 1 Then WaitTime = 10
Dim YanShi%
DoEvents
相关文档:
从网上搜集到的VB代码,用EXE方式实现了远程注入,不过在反病毒软件的保护下,有可能导致注入失败。转贴这个代码,仅供大家学习和参考。
一、窗口代码:
Option Explicit
Private Sub cmdLock_Click()
If LockKeyboard(True) Then
cmdLock.Enabled = False
cmdUnLock.Enabled = Tr ......
虽然WindowsXP的界面非常华丽。但是令人遗憾的是,我们用VB写的程序除了菜单和窗口的外观是XP风格外,其他控件还是一如既往的是普通风格。我想,有的程序在XP下有XP的风格,VB也一定有办法实现XP的风格。后来笔者在网上看到一篇介绍XML的文章,又在网上找到了一篇实现XP风格的文章,经过自己的实践,终于找到了VB程序 ......
很久以前的一个代码了。。。。。那时还沉迷于研究WindowsXP登录密码的计算方法。。。。
先新建一个VB工程,画一个CommandButton,改名为cmdGetSYSKEY,画一个TextBox,改名为txtSYSKEY,然后粘贴下面的代码,运行即可,在WindowsXP SP2 Build 2600 + VB6.0 SP6下测试通过,获得的SYSKEY与Cain&Abel v4.9.6一致。。。。 ......
Option Explicit
Function Delete3(Arr As Variant) As Variant
Dim i As Integer
For i = LBound(Arr) To UBound(Arr)
If i > UBound(Arr) Then Exit For
If Arr(i) = 3 Then
Do
Dim j As Integer
For j = i To UBound(Arr) - 1
......