枚举桌面上的所有窗口句柄 [英] Enumerate all window handles on desktop

查看:285
本文介绍了枚举桌面上的所有窗口句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个Win32 API的方式来获得所有打开的窗口的枚举?好像有一定只是不知道从哪里开始寻找。

Is there a Win32 API way to get an enumeration of all the open windows? Seems like there must be just not sure where to start looking.

推荐答案

EnumWindows的()对于那些。你怎么称呼它,并提供一个回调。它调用每一个发现窗口回调并传递一个句柄的窗口。

EnumWindows() is for that. You call it and provide a callback. It invokes the callback for every found window and passes a handle to that window.

您就可以使用该句柄来查询窗口参数,并决定是否对你感兴趣或者做一些动作吧。

You can then use the handle to query the window parameters and decide whether it is of interest for you or do some action with it.

这篇关于枚举桌面上的所有窗口句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆