| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1754 人关注过本帖
标题:用findwindow找不到窗口句柄!高手来下!
只看楼主 加入收藏
a5538758
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2009-7-23
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
用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 编辑 ]
搜索更多相关主题的帖子: 句柄 findwindow 窗口 
2009-08-12 23:25
workhow
Rank: 2
等 级:论坛游民
帖 子:122
专家分:21
注 册:2007-8-31
收藏
得分:20 
因为这游戏有保护,还是驱动级的保护。用常规的方法当然找不到句柄。
会的人也不怎么肯说出来。商业上的原因。
2009-08-16 13:03
快速回复:用findwindow找不到窗口句柄!高手来下!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027674 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved