EnumWindows function
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的更多相关文章
- EnumWindows 使用
转载自csdn:http://blog.csdn.net/hairi/article/details/548064 EnumWindows 用来列举屏幕上所有顶层窗口. MSDN原话: The E ...
- 使用 EnumWindows 找到满足你要求的窗口
原文:使用 EnumWindows 找到满足你要求的窗口 在 Windows 应用开发中,如果需要操作其他的窗口,那么可以使用 EnumWindows 这个 API 来枚举这些窗口. 本文介绍使用 E ...
- 使用 EnumWindows 找到满足你要求的窗口 - walterlv
原文:使用 EnumWindows 找到满足你要求的窗口 - walterlv 使用 EnumWindows 找到满足你要求的窗口 2019-04-30 13:11 在 Windows 应用开发中,如 ...
- UI僵死分析
原因剖析 UI僵死无非只是因为UI线程因繁忙而无法去接受用户的响应.详细说来内在原因有以下两个: 正常的业务代码写在UI线程中执行,业务代码的任务繁重导致UI线程无法分身去接受用户的界面输入 UI控件 ...
- C++ 判断进程是否存在
原文:http://blog.csdn.net/u010803748/article/details/53927977?locationNum=2&fps=1 一.判断指定程序名的进程是否存在 ...
- 聊聊Python ctypes 模块(转载)
https://zhuanlan.zhihu.com/p/20152309?columnSlug=python-dev 作者:Jerry Jho链接:https://zhuanlan.zhihu.co ...
- Delphi7所使用的WinAPI大全(摘自VCL源码,一共1200个函数)
经过我整理的,去掉了A和W的重复.虽然没写注释,但以后要一个一个研究.有这些WINAPI就够用了. kernel32 = 'kernel32.dll'; gdi32 = 'gdi32.dll'; us ...
- 通过百度echarts实现数据图表展示功能
现在我们在工作中,在开发中都会或多或少的用到图表统计数据显示给用户.通过图表可以很直观的,直接的将数据呈现出来.这里我就介绍说一下利用百度开源的echarts图表技术实现的具体功能. 1.对于不太理解 ...
- (C/C++) Callback Function 回调(diao)函数
原文: http://www.codeguru.com/cpp/cpp/cpp_mfc/callbacks/article.php/c10557/Callback-Functions-Tutorial ...
随机推荐
- kernel32.dll出错解决方案
kernel32.dll 一.什么是kernel32内核文件 kernel32.dll是Windows 9x/Me中非常重要的32位动态链接库文件,属于内核级文件.它控制着系统的内存管理.数据的输入输 ...
- shell 在文件名后面添加特定数据
for a in `ls mo-*`;do mv ${a%:} ${a%:}-1;done
- sql如何将同个字段不同值打印在一行
group_concat(distinct(img)) group by id通过id分组把img的值打印在一行group_concat()通常和group by一起使用,功能是把某个字段的值打印在一 ...
- ftp 终端命令
近期使用 macbook,并与新买的路由器折腾, 先备着... http://blog.csdn.net/qinde025/article/details/7595102 ftp使用的内部命令如下(其 ...
- python DB.fetchall()--获取数据库所有记录列表
查询到的数据格式为列表: 多个元素的列表:
- 学习Perl6: slice fastq file
需求: 只获取 ath 物种的 hairpin 序列 文件格式如下所示,以>打头的为 header,紧跟的为序列[AUCG]+ (Perl5 regexp 格式) #!/usr/bin/env ...
- linux下用core和gdb查询出现"段错误"的地方【转】
转自:http://blog.chinaunix.net/uid-30091091-id-5754288.html 原文地址:linux下用core和gdb查询出现"段错误"的地方 ...
- Makefile学习之make 的运行【转】
转自:http://blog.csdn.net/suzilong11/article/details/7852830 —————— 一般来说,最简单的就是直接在命令行下输入make命令,make命令会 ...
- java.security.NoSuchAlgorithmException: DES KeyGenerator not available
更改jre,点击项目build path-->configure build path-->libraries-->jre library system-->edit--> ...
- ActiveMQ 安装异常
解决方式: 1.确认计算机主机名名称没有下划线: 2.如果是win7,停止ICS(运行-->services.msc找到Internet Connection Sharing (ICS)服务,改 ...