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 ...
随机推荐
- 【pyQuery】抓取startup news首页
#! /usr/bin/python # coding: utf-8 from pyquery import PyQuery c=PyQuery('http://news.dbanotes.net/' ...
- 项目中empty遇到的一个问题
搜索传参时,数据能获取到,搜索结果不是根据参数得出的,在定义搜索条件时因为empty引起的一个问题,键为0的值没有获取到, 记住:!empty 已经把0排除了
- Delphi Xe2 后的版本如何让Delphi程序启动自动“以管理员身份运行"
由于Vista以后win中加入的UAC安全机制,采用Delphi开发的程序如果不右键点击“以管理员身份运行”,则会报错. 在XE2以上的Delphi版本处理这个问题已经非常简单了. 右建点击工程,选择 ...
- mysql命令行操作
显示数据库 show databases;当前数据库 select database(); 显示表 show tables;更改表名称 alter table 原表名 rename ...
- json校验
直接百度:json在线解析 或 json.cnhttp://json.cn/ json格式校验的.这个更加简洁些.
- HttpContext.Current.Cache在控制台下不工作
说明: Cache 类不能在 ASP.NET 应用程序外使用.它是为在 ASP.NET 中用于为 Web 应用程序提供缓存而设计和测试的.在其他类型的应用程序(如控制台应用程序或 Windows 窗体 ...
- PHP序列化以及反序列化系列[1]--PHP序列化格式的写法
反序列化:对单一的已序列化的变量进行操作,将其转换回 PHP 的值(zval). PHP序列化方式 PHP在序列化的时候会将相应的变量以对应的键值进行储存. 将一个类序列化的话,处理代码主要的 文件: ...
- Git的搭建和使用技巧完整精华版
[Git使用技巧] 1.把一个已经存在于版本库中的文件加入忽略提交文件(.gitignore)中,需要如下代码: git rm --cached [文件路径] 例如: git rm --cached ...
- HDU 1024:Max Sum Plus Plus(DP)
http://acm.hdu.edu.cn/showproblem.php?pid=1024 Max Sum Plus Plus Problem Description Now I think you ...
- git 冲突
git中冲突会用特殊的标记 (<<<<<<<=======>>>>>>>) 特殊标记<<<< ...