1,488
社区成员
发帖
与我相关
我的任务
分享Option Explicit
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, "NavyFIELD") ' 取得进程标识符
'只要把Windows Media Player换成游戏的名称就可了!
If hwnd = 0 Then
Label1.Caption = "游戏未运行"
Else
Label1.Caption = "游戏已运行"
End If
End Sub