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. enum与typedef enum的用法

    一,两者的用法 枚举类型定义用关键字enum标识,形式为: enum 标识符 { 枚举数据表 }:枚举数据(枚举常量)是一些特定的标识符,标识符代表什么含义,完全由程序员决定.数据枚举的顺序规定了枚举 ...

  2. Qt源码包中的一段代码

    之所以单独拣出来是因为Qt的开发者们给普通开发者提供了高效编程的商业代码例子: bool QWidget::testAttribute_helper(Qt::WidgetAttribute attri ...

  3. SQL UNION 操作符

    转由http://www.w3school.com.cn/sql/sql_union.asp 这个网址的数据库知识,个人推荐,因为有实例,理解更透彻一些.非广告啊,个人感觉好啊 SQL UNION 操 ...

  4. flexbox in IE (10+ and 9 and 8)

    .parent { display: -webkit-box !important; display: -moz-box !important; display: -ms-flexbox !impor ...

  5. SELECT INTO和INSERT INTO SELECT

    --自动创建了target_table表,并复制source_table表的数据到target_table select name,age into target_table from source_ ...

  6. HTTP详解(1)-工作原理【转】

    转自:http://blog.csdn.net/hguisu/article/details/8680808 版权声明:本文为博主原创文章,未经博主允许不得转载.   目录(?)[-] 1 HTTP简 ...

  7. Redis整合Spring结合使用缓存实例

    林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文介绍了如何在Spring中配置redis,并通过Spring中AOP的思想,将缓存的 ...

  8. NSDictionary to jsonString || 对象转json格式

    -(NSString*)DataTOjsonString:(id)object { NSString *jsonString = nil; NSError *error; NSData *jsonDa ...

  9. C#:数据交互

    JS与Web交互:http://www.docin.com/p-76710976.html 一.WinForm的WebBrowser控件与JS交互数据: 1.C#类内的代码执行JS脚本函数: 给C#类 ...

  10. Fibonacci Again 分类: HDU 2015-06-26 11:05 13人阅读 评论(0) 收藏

    Fibonacci Again Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tot ...