没有合适的资源?快使用搜索试试~ 我知道了~
查找指定标题的子窗口
需积分: 33 6 下载量 163 浏览量
2017-09-08
13:46:03
上传
评论
收藏 3KB TXT 举报
温馨提示
试读
4页
PB代码,通过指定窗口标题或类名,查找具有该标题或类名的窗口,包括子窗口。采用了高效的迭代算法,代码绝对高效,好用!
资源推荐
资源详情
资源评论
//以下为API声明
FUNCTION Long FindWindow(Long lpClassName,String lpWindowName) LIBRARY 'user32.dll' ALIAS FOR FindWindowA
FUNCTION Long FindWindowEx(Long hWnd1, Long hWnd2, String lpsz1, String lpsz2) LIBRARY 'user32.dll' ALIAS FOR FindWindowExA
FUNCTION Long GetWindow(Long hWnd, Long wCmd) LIBRARY 'user32.dll'
FUNCTION Long GetParent(Long hWnd) LIBRARY 'user32.dll'
FUNCTION Long GetClassName(Long hWnd, REF String lpClassName, Long nMaxCount) LIBRARY "user32.dll" ALIAS FOR "GetClassNameA"
FUNCTION Long GetWindowText(Long hWnd, REF String lpString, Long cch) LIBRARY "user32.dll" ALIAS FOR "GetWindowTextA"
//以下为代码
Long hMain,hCurrent,hTest
Integer m_iDirection,ix,iy
String buf = Space(255)
String sClass, sWinText
CONSTANT String sTilter = '管理软件'
CONSTANT String sFindClassName = 'Button';
CONSTANT String sFindWinText = 'Tab Controllor';
CONSTANT String sTargetClassName = 'PBNICanvas';
m_iDirection = 1
//遍历窗口
hMain = FindWindow(0,sTilter)
IF hMain = 0 THEN RETURN 0
hCurrent = GetWindow(hMain, 5) //GW_CHILD=5
IF hCurrent = 0 THEN RETURN 0
DO While (m_iDirection <> -1)
FUNCTION Long FindWindow(Long lpClassName,String lpWindowName) LIBRARY 'user32.dll' ALIAS FOR FindWindowA
FUNCTION Long FindWindowEx(Long hWnd1, Long hWnd2, String lpsz1, String lpsz2) LIBRARY 'user32.dll' ALIAS FOR FindWindowExA
FUNCTION Long GetWindow(Long hWnd, Long wCmd) LIBRARY 'user32.dll'
FUNCTION Long GetParent(Long hWnd) LIBRARY 'user32.dll'
FUNCTION Long GetClassName(Long hWnd, REF String lpClassName, Long nMaxCount) LIBRARY "user32.dll" ALIAS FOR "GetClassNameA"
FUNCTION Long GetWindowText(Long hWnd, REF String lpString, Long cch) LIBRARY "user32.dll" ALIAS FOR "GetWindowTextA"
//以下为代码
Long hMain,hCurrent,hTest
Integer m_iDirection,ix,iy
String buf = Space(255)
String sClass, sWinText
CONSTANT String sTilter = '管理软件'
CONSTANT String sFindClassName = 'Button';
CONSTANT String sFindWinText = 'Tab Controllor';
CONSTANT String sTargetClassName = 'PBNICanvas';
m_iDirection = 1
//遍历窗口
hMain = FindWindow(0,sTilter)
IF hMain = 0 THEN RETURN 0
hCurrent = GetWindow(hMain, 5) //GW_CHILD=5
IF hCurrent = 0 THEN RETURN 0
DO While (m_iDirection <> -1)
资源评论
mxxgmxxg1
- 粉丝: 1
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功