VB 从零开始编外挂(一)

时间:2009-02-02 07:35:26  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:rocessId ←获取与指定窗口关联在一起的一个进程和线程标识符 -------------------------------------------------------------------------------------------------------------------------------------------------------- 相关API声明: FindWindow ↓ Private Declare Function FindWindow Lib "user32" Alias "FindWindowA&qu...
  正文: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

VB 从零开始编外挂(一)》由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Language/VB/2009-02-02/8924.html


关键字:

关于《VB 从零开始编外挂(一)》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td