馬上註冊  |  找回密碼

SAY討論區

查看: 322|回復: 2
打印 上一主題 下一主題

VB 從零開始編外掛 [複製鏈接]

好友
0
帖子
129603
積分
134548
最後登錄
2019-2-28
在線時間
0 小時
跳轉到指定樓層
樓主
發表於 2012-5-23 18:20:03 |只看該作者 |倒序瀏覽
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
共有七節...先放一節,想要完整七節,請留言支持 並下載附件!
分享分享0 收藏收藏0 讚好讚好0 Unlike!Unlike!0 分享 傳送 邀請

好友
0
帖子
124380
積分
124386
最後登錄
2019-2-28
在線時間
0 小時
No.1回覆者
發表於 2012-5-23 19:54:37 |只看該作者
我幫你這一帖頂起來

好友
0
帖子
125011
積分
125066
最後登錄
2019-2-28
在線時間
0 小時
跟尾2
發表於 2012-5-23 20:10:59 |只看該作者
飯可以亂吃,話也可以亂說,但帖子不可以亂髮哦
您需要登錄後才可以回帖 登錄 | 馬上註冊 |

Archiver|手機版|SAY討論區

GMT+8, 2026-5-29 01:23 , Processed in 0.645553 second(s), 8 queries .

Powered by go2tutor.comDiscuz! X2

© 2026 Community Networks Limited

回頂部