- UID
- 17698
- 帖子
- 716
- 主題
- 71
- 精華
- 1
- 積分
- 104
- 楓幣
- 184
- 威望
- 5
- 存款
- 0
- 贊助金額
- 100
- 推廣
- 0
- GP
- 6
- 閱讀權限
- 30
- 性別
- 男
- 在線時間
- 1086 小時
- 註冊時間
- 2012-11-25
- 最後登入
- 2022-3-14
|
本帖最後由 lssce1122 於 2013-2-13 23:46 編輯
Public Function FindGame(ByVal strGameName As String) As Boolean
Dim pe32 As PROCESSENTRY32
Dim hSnapshot As Long
Dim bProcFound As Object
Dim bFoundGame As Boolean
hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0&)
pe32.dwSize = Len(pe32)
bProcFound = Process32First(hSnapshot, pe32)
With bFoundGame
If Right$(LCase$(Left$(pe32.szexeFile, InStr(1, pe32.szexeFile, Chr(0)) - 1)), Len(strGameName)) = LCase$(strGameName) Then
dwProcId = pe32.th32ProcessID
bFoundGame = True
Else
bFoundGame = False
End If
bProcFound = Process32Next(hSnapshot, pe32)
End With
CloseHandle hSnapshot
FindGame = bFoundGame
End Function
這裡不知道哪裡錯了 |
|