回 帖 发 新 帖 刷新版面

主题:[转帖]VB 从零开始编外挂

VB 从零开始编外挂(一)
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要VB API函数:
FindWindow                              ←寻找窗口列表中第一个符合指定条件的顶级窗口
GetWindowThreadProcessId       ←获取与指定窗口关联在一起的一个进程和线程标识符
--------------------------------------------------------------------------------------------------------------------------------------------------------
相关API声明:
FindWindow

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

GetWindowThreadProcessId

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long)
As Long
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要的控件:Label、Timer
--------------------------------------------------------------------------------------------------------------------------------------------------------   自定义函数:
Dim hwnd As Long
--------------------------------------------------------------------------------------------------------------------------------------------------------   源代码:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long)As Long
Private Sub Timer1_Timer()
Dim hwnd As Long' 储存 FindWindow 函数返回的句柄
hwnd = FindWindow(vbNullString, "Windows Media Player")' 取得进程标识符
'只要把Windows Media Player换成游戏的名称就可了!
If hwnd = 0 Then
Label1.Caption = "游戏未运行"
Else
Label1.Caption = "游戏已运行"
End If
End Sub

回复列表 (共16个回复)

11 楼

老大说话!
嘘!各位哥们!请保持你的风度!
哈哈!
请接受我的道歉!楼主!

12 楼

好贴啊,往死里顶,加上10000000分,楼主很想拜你为师啊!  
  接受我不? QQ119887

13 楼

楼主能不能发个现成的给我挂一下呀谢谢

14 楼

我的主页上有,看我的签名

15 楼

好贴!

16 楼

ding

我来回复

您尚未登录,请登录后再回复。点此登录或注册