用findwindow找不到窗口句柄!高手来下!
用findwindow找不到窗口句柄,这是我的代码Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Private Sub Command1_Click()
Dim cc As Long
Dim cc2 As Long
Dim cc3 As Long
cc = FindWindow(vbNullString, "地下城与勇士")
If cc = 0 Then
MsgBox "找不到游戏"
else
msgbox"成功"
End Sub
我用这段代码
每次返回值都是0啊
[ 本帖最后由 a5538758 于 2009-8-12 23:34 编辑 ]