https://msdn.microsoft.com/en-us/library/windows/desktop/ms633497(v=vs.85).aspx

Enumerates all top-level windows on the screen by passing the handle to each window, in turn, to an application-defined callback function.

EnumWindows continues until the last top-level window is enumerated or the callback function returns FALSE.

C++的代码

BOOL WINAPI EnumWindows(
_In_ WNDENUMPROC lpEnumFunc,
_In_ LPARAM lParam
);

Parameters

lpEnumFunc [in]

Type: WNDENUMPROC

A pointer to an application-defined callback function.  指向回调函数的指针

For more information, see EnumWindowsProc.

lParam [in]

Type: LPARAM

An application-defined value to be passed to the callback function.  传递给回调函数的参数

Return value

Type:

Type: BOOL

If the function succeeds, the return value is nonzero.    函数执行成功,返回值不为0

If the function fails, the return value is zero. To get extended error information, call GetLastError.   执行失败的话,返回0,并且可以通过GetLastError获取详细的错误信息

If EnumWindowsProc returns zero, the return value is also zero. In this case, the callback function should call SetLastError to obtain a meaningful error code to be returned to the caller of EnumWindows.

Remarks

The EnumWindows function does not enumerate child windows, with the exception of a few top-level windows owned by the system that have the WS_CHILD style.

This function is more reliable than calling the GetWindow function in a loop.

An application that calls GetWindow to perform this task risks being caught in an infinite无限的 loop or referencing a handle to a window that has been destroyed.

Note

For Windows 8 and later, EnumWindows enumerates only top-level windows of desktop apps.

EnumWindows function的更多相关文章

  1. EnumWindows 使用

    转载自csdn:http://blog.csdn.net/hairi/article/details/548064   EnumWindows 用来列举屏幕上所有顶层窗口. MSDN原话: The E ...

  2. 使用 EnumWindows 找到满足你要求的窗口

    原文:使用 EnumWindows 找到满足你要求的窗口 在 Windows 应用开发中,如果需要操作其他的窗口,那么可以使用 EnumWindows 这个 API 来枚举这些窗口. 本文介绍使用 E ...

  3. 使用 EnumWindows 找到满足你要求的窗口 - walterlv

    原文:使用 EnumWindows 找到满足你要求的窗口 - walterlv 使用 EnumWindows 找到满足你要求的窗口 2019-04-30 13:11 在 Windows 应用开发中,如 ...

  4. UI僵死分析

    原因剖析 UI僵死无非只是因为UI线程因繁忙而无法去接受用户的响应.详细说来内在原因有以下两个: 正常的业务代码写在UI线程中执行,业务代码的任务繁重导致UI线程无法分身去接受用户的界面输入 UI控件 ...

  5. C++ 判断进程是否存在

    原文:http://blog.csdn.net/u010803748/article/details/53927977?locationNum=2&fps=1 一.判断指定程序名的进程是否存在 ...

  6. 聊聊Python ctypes 模块(转载)

    https://zhuanlan.zhihu.com/p/20152309?columnSlug=python-dev 作者:Jerry Jho链接:https://zhuanlan.zhihu.co ...

  7. Delphi7所使用的WinAPI大全(摘自VCL源码,一共1200个函数)

    经过我整理的,去掉了A和W的重复.虽然没写注释,但以后要一个一个研究.有这些WINAPI就够用了. kernel32 = 'kernel32.dll'; gdi32 = 'gdi32.dll'; us ...

  8. 通过百度echarts实现数据图表展示功能

    现在我们在工作中,在开发中都会或多或少的用到图表统计数据显示给用户.通过图表可以很直观的,直接的将数据呈现出来.这里我就介绍说一下利用百度开源的echarts图表技术实现的具体功能. 1.对于不太理解 ...

  9. (C/C++) Callback Function 回调(diao)函数

    原文: http://www.codeguru.com/cpp/cpp/cpp_mfc/callbacks/article.php/c10557/Callback-Functions-Tutorial ...

随机推荐

  1. 【py网页】urllib模块,urlopen

    Python urllib 库提供了一个从指定的 URL 地址获取网页数据,然后对其进行分析处理,获取想要的数据. 下面是在 Python Shell 里的 urllib 的使用情况: 01 Pyth ...

  2. 最懂中文的H5前端框架amazeUI

    Amaze UI 是一个轻量级(所有 CSS 和 JS gzip 后 100 kB 左右)的前端框架, 基于开源社区流行前端框架编写 amazeUI的网址:http://amazeui.org/get ...

  3. ipseccmd命令解析

    IPSec 首先需要指出的是,IPSec和TCP/IP筛选是不同的东西,大家不要混淆了.TCP/IP筛选的功能十分有限,远不如IPSec灵活和强大.下面就说说如何在命令行下控制IPSec. XP系统用 ...

  4. JVM总结

    1. 内存分布: 1). 程序计数器(Program Counter Register)是一块较小的内存空间,它的作用可以看做是当前线程所执行的字节码的行号指示器.线程私有.如果线程正在执行的是一个J ...

  5. 由于 add 运算符中“Chinese_PRC_CI_AS”和“Chinese_PRC_CS_AS_WS”之间的排序规则冲突

    有一个字段的排序规则是 Chinese_PRC_CS_AS_WS,字符串连接的时候报错. 处理方案 cast(columnName as varbinary) 即可

  6. Install Hive

    一.Hive将元数据存储在RDBMS中,有三种模式可以连接到数据: 1.single User Mode:此模式连接到一个In-memory的数据库Derby,一般用于Unit Test. 2.Mul ...

  7. NSScanner用法详解

    NSScanner类用于在字符串中扫描指定的字符,尤其是把它们翻译/转换为数字和别的字符串.可以在创建NSScaner时指定它的string属性,然后scanner会按照你的要求从头到尾地扫描这个字符 ...

  8. Linux字符串替换一例:根据IP地址获取指定内容

    需求:使用脚本获取到本机IP地址,需要添加iptables规则,需生成网段地址 源格式:获取IP地址为10.10.10.221 目标格式:10.10.10.0 # 方法1 [hadoop@localh ...

  9. WPF:MenuItem样式

    基础信息 1.MenuItem 样式 <Window.Resources> <Style TargetType="{x:Type MenuItem}"> & ...

  10. C#:实现托盘(任务栏图标与托盘图标互斥)

    实现托盘(任务栏图标与托盘图标互斥),并且在点击任务栏图标时实现的最小化与点击最小化按钮分离. 具体如下: 1.向窗体上添加如下控件:MenuStrip menuStrip1, NotifyIcon ...