EnumChildWindows
EnumChildWindows
函数功能:枚举一个父窗口的所有子窗口。
函数原型:BOOL EnumChildWindows(HWND hWndParent,WNDENUMPROC lpEnumFunc, LPARAM lParam);
参数说明:
HWND hWndParent, // handle to parent window // 父窗口句柄
WNDENUMPROC lpEnumFunc, // callback function // 回调函数的地址
LPARAM lParam // application-defined value // 你自已定义的参数
注意:
1、这个回调函数要么是类的静态函数,要么就是一个全局的函数。
2、在调用EnumChildWindows 时,直到调用到最后以一个子窗口被枚举或回调函数返回一个false,否则将一直枚举下去。
3、子窗口下属的子窗口也可由EnumChildWindows 枚举
EnumChildWindows Function
The EnumChildWindows function enumerates the child windows that belong to the specified parent window by passing the handle to each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE.
Syntax
BOOL EnumChildWindows( HWND hWndParent,
WNDENUMPROC lpEnumFunc,
LPARAM lParam
);Parameters
hWndParent
[in] Handle to the parent window whose child windows are to be enumerated. If this parameter is NULL, this function is equivalent to EnumWindows.
Windows 95/98/Me: hWndParent cannot be NULL.
lpEnumFunc
[in] Pointer to an application-defined callback function. For more information, see EnumChildProc.
lParam
[in] Specifies an application-defined value to be passed to the callback function.
Return Value
Remarks
If a child window has created child windows of its own, EnumChildWindows enumerates those windows as well.
A child window that is moved or repositioned in the Z order during the enumeration process will be properly enumerated. The function does not enumerate a child window that is destroyed before being enumerated or that is created during the enumeration process.
Example
For an example see Destroying a Window.
EnumChildWindows的更多相关文章
- [原创]C#应用WindowsApi实现查找\枚举(FindWindow、EnumChildWindows)窗体控件,并发送消息。
首先介绍基本WindowsApi: public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); 函 ...
- ]用EnumChildWindows遍历窗口的方法
最近项目有需要,得到一个非自己实现的窗口控件对象.于是想起曾经做过类似功能.总结如下: 调用EnumChildWindows(this->m_hWnd, EnumChildProc, NULL) ...
- 枚举子窗口EnumChildWindows()的应用
1.EnumChildWindows()函数的作用枚举子窗口(按顺序调用回调函数,并将子窗口的句柄传递给了回调函数).函数原型: BOOL WINAPI EnumChildWindows( HWND ...
- Delphi实现获取句柄并发送消息的方法(FindWindow、FindWindowEx、EnumChildWindows、SendMessage)
Delphi实现获取句柄并发送消息的方法 本文以实例形式详细说明了Delphi获取句柄并发送消息的方法,具体用法说明如下: 查找另外一个窗口的句柄: handle := FindWindow(nil, ...
- [WinAPI] 获取窗口句柄的几种方法
1.使用FindWindow函数获取窗口句柄 示例:使用FindWindow函数获取窗口句柄,然后获得窗口大小,并且移动窗口到指定位置. 我们想获得酷我音乐盒的窗口句柄并移动它,该怎么办呢? 首先打开 ...
- Windows API 函数列表 附帮助手册
所有Windows API函数列表,为了方便查询,也为了大家查找,所以整理一下贡献出来了. 帮助手册:700多个Windows API的函数手册 免费下载 API之网络函数 API之消息函数 API之 ...
- C#调用win32 api 操作其它窗口
实现以下功能: 找到窗体 找到控件(也叫子窗体) 获取内容 获取位置 设置 位置 内容 鼠标点击 示范 1. 找窗体 以操作系统自带的计算器为例 string clWindow = "Cal ...
- C#根据句柄改变窗体控件值
需求是这样,有个程序界面我们需要通过自己的程序持续输入数据,界面如图. 可以获得控件的句柄而用钩子写入值.这里需要用到spy++工具.在VS的工具下有个spy++工具,打开如下图 通过这个工具可以获得 ...
- 【转】Windows 窗口层次关系
原文链接:undefined! 相信在Windows 下面编程的很多兄弟们都不是很清楚Windows 中窗口的层次关系是怎么样的,这个东西很久已经研究过一下,后来又忘记了,今天又一次遇到了这个问题,所 ...
随机推荐
- Tinkoff Challenge - Final Round (Codeforces Round #414, rated, Div. 1 + Div. 2) 继续跪一把
这次的前三题挺简单的,可是我做的不快也不对. A. Bank Robbery time limit per test 2 seconds memory limit per test 256 megab ...
- SPOJ - DQUERY 主席树求区间有多少个不同的数(模板)
D-query Time Limit: 227MS Memory Limit: 1572864KB 64bit IO Format: %lld & %llu Submit Status ...
- BZOJ 1069 [SCOI2007]最大土地面积 ——计算几何
枚举对角线,然后旋转卡壳即可. #include <map> #include <cmath> #include <queue> #include <cstd ...
- STL中heap用法
#include<cstdio> #include<iostream> #include<algorithm> using namespace std; ]={,, ...
- SHoj A序列
A序列 发布时间: 2017年7月9日 18:17 最后更新: 2017年7月9日 21:05 时间限制: 1000ms 内存限制: 128M 描述 如果一个序列有奇数个正整数组成,不妨令 ...
- HDU [P3949] XOR
线性基求第 k 小异或值 http://www.cnblogs.com/Mr-WolframsMgcBox/p/8567844.html 这道题消元下来是一个上三角矩阵,代码简单,但是不使用与本题的情 ...
- *Codeforces963C. Cutting Rectangle
$n \leq 200000$种互不相同的矩形,给长宽和数量,都$\leq 1e12$,问有多少种大矩形只沿平行长和宽切正好切成这些矩形. 首先可以发现在一个合法情况下,有些矩形的位置是可以乱挪的,比 ...
- Laravel5.1 报错:控制器不存在
Laravel5.1 报错:控制器不存在 错误提示: Class App\Http\Controllers\Api/UserController does not exist 解决: (1)检查控制器 ...
- Idea其他设置
一.生成javadoc Tools->Gerenate JavaDoc 1. 选择是整个项目还是模块还是单个文件 2. 文档输出路径 3. Locale 选择地区,这个决定了文档的语言,中文就是 ...
- POJ 1991 Turning in Homework(区间DP)
题目链接 Turning in Homework 考虑区间DP $f[i][j][0]$为只考虑区间$[i, j]$且最后在$a[i]$位置交作业的答案. $f[i][j][1]$为只考虑区间$[i, ...