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的更多相关文章

  1. [原创]C#应用WindowsApi实现查找\枚举(FindWindow、EnumChildWindows)窗体控件,并发送消息。

    首先介绍基本WindowsApi: public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); 函 ...

  2. ]用EnumChildWindows遍历窗口的方法

    最近项目有需要,得到一个非自己实现的窗口控件对象.于是想起曾经做过类似功能.总结如下: 调用EnumChildWindows(this->m_hWnd, EnumChildProc, NULL) ...

  3. 枚举子窗口EnumChildWindows()的应用

    1.EnumChildWindows()函数的作用枚举子窗口(按顺序调用回调函数,并将子窗口的句柄传递给了回调函数).函数原型: BOOL WINAPI EnumChildWindows( HWND ...

  4. Delphi实现获取句柄并发送消息的方法(FindWindow、FindWindowEx、EnumChildWindows、SendMessage)

    Delphi实现获取句柄并发送消息的方法 本文以实例形式详细说明了Delphi获取句柄并发送消息的方法,具体用法说明如下: 查找另外一个窗口的句柄: handle := FindWindow(nil, ...

  5. [WinAPI] 获取窗口句柄的几种方法

    1.使用FindWindow函数获取窗口句柄 示例:使用FindWindow函数获取窗口句柄,然后获得窗口大小,并且移动窗口到指定位置. 我们想获得酷我音乐盒的窗口句柄并移动它,该怎么办呢? 首先打开 ...

  6. Windows API 函数列表 附帮助手册

    所有Windows API函数列表,为了方便查询,也为了大家查找,所以整理一下贡献出来了. 帮助手册:700多个Windows API的函数手册 免费下载 API之网络函数 API之消息函数 API之 ...

  7. C#调用win32 api 操作其它窗口

    实现以下功能: 找到窗体 找到控件(也叫子窗体) 获取内容 获取位置 设置 位置 内容 鼠标点击 示范 1. 找窗体 以操作系统自带的计算器为例 string clWindow = "Cal ...

  8. C#根据句柄改变窗体控件值

    需求是这样,有个程序界面我们需要通过自己的程序持续输入数据,界面如图. 可以获得控件的句柄而用钩子写入值.这里需要用到spy++工具.在VS的工具下有个spy++工具,打开如下图 通过这个工具可以获得 ...

  9. 【转】Windows 窗口层次关系

    原文链接:undefined! 相信在Windows 下面编程的很多兄弟们都不是很清楚Windows 中窗口的层次关系是怎么样的,这个东西很久已经研究过一下,后来又忘记了,今天又一次遇到了这个问题,所 ...

随机推荐

  1. 【Luogu】P1462通往奥格瑞玛的道路(二分答案+SPFA)

    题目链接 导致我WA十几遍的原因居然是最大值不够大……以后再也不相信memset(dis,127/3,sizeof(dis))了. 此题先将花费排序,然后二分最大花费,spfa判断解是否可行.spfa ...

  2. SHOWMODALDIALOG表单提交时禁止打开新窗口

    前提条件:showmodaldialog中有表单form.当action="#"的时候,提交表单,不会打开新窗口,但这种#自提有时不能用,#是本页面完整的带参数的url,如果表单中 ...

  3. Linux(6):定时任务

    定时任务 定时任务的说明和分类 # 定时任务分类: 1. crond(crontab) 定时任务软件(软件包 cronie) 2. atd 运行一次 3. anacron 非7*24小时运行的服务器 ...

  4. hdu 4430 Yukari's Birthday 枚举+二分

    注意会超long long 开i次根号方法,te=(ll)pow(n,1.0/i); Yukari's Birthday Time Limit: 12000/6000 MS (Java/Others) ...

  5. 第一行代码 Android 思维导图

    第一行代码 Android  思维导图

  6. numpy数组之读写文件

    目录 通过 numpy 读写 txt 或 csv 文件 通过 numpy 读写 npy 或 npz 文件 读写 npy 文件 读写 npz 文件 通过 h5py 读写 hdf5 文件 简单读取 通过切 ...

  7. [Bzoj5254][Fjwc2018]红绿灯(线段树)

    5254: [Fjwc2018]红绿灯 Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 31  Solved: 24[Submit][Status][D ...

  8. 深入GCD(二): 多核心的性能

    概念为了在单一进程中充分发挥多核的优势,我们有必要使用多线程技术(我们没必要去提多进程,这玩意儿和GCD没关系).在低层,GCD全局dispatch queue仅仅是工作线程池的抽象.这些队列中的Bl ...

  9. android 查看手机运行的进程列表

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools=&q ...

  10. jmeter.properties控制聚合报告的用户响应时间设置和smmary results

    jmeter.properties的配置Summariser控制输出Summary Results,可以显式rt和tps等信息 Aggregate Report配置可以控制聚合报告的内容,控制90%用 ...