遍历句柄所有子窗口 win32gui.EnumChildWindows

2023-05-16

The handler is indeed called for each child:

>>> def all_ok(hwnd, param):
...     print hwnd
...     return True
...

>>> win32gui.EnumChildWindows(parent_handle, all_ok, None)
17630538
12911940
8260536
4131432
14356400
11471888
9048526
18942076
8523526
#etc...
It's just that EnumChildWindows itself doesn't return anything. If you want to have all of the child window handles in a list, do that in the handler:

>>> parent_handle = 33230502
>>> child_handles = []
>>> def all_ok(hwnd, param):
...     child_handles.append(hwnd)
...
>>> win32gui.EnumChildWindows(parent_handle, all_ok, None)
>>> child_handles
[17630538, 12911940, 8260536, 4131432, 14356400, 11471888, 9048526, 18942076, 8523526, 6951400, 5968556, 19203900, 4459544, 15208240, 9700614, 5769012, 11277176, 7409598, 10225510, 8392342, 19270296, 32377256, 7276984, 20449052, 8262502, 11734380, 14749460, 5310608, 3935978, 125374254, 8457268, 2621704, 24840652, 5706936, 35261636, 10357170, 5641372, 8260848, 6559366]
>>>

参考
https://stackoverflow.com/questions/12253858/enumchildwindows-not-working-in-pywin32

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

遍历句柄所有子窗口 win32gui.EnumChildWindows 的相关文章

  • XPath 简单语法 (三)

    XPath表达式 2008 02 27 16 55 XML 文档对象模型 DOM 能够以编程方式读取 处理和修改 XML 文档 XPath 表达式 XPath 表达式使用路径表示法 xff08 与 URL 中使用的路径表示法类似 xff09
  • Error: cannot open display: localhost:0.0

    https stackoverflow com questions 12356425 error cannot open display localhost0 0 trying to open firefox from centos 6 在

随机推荐

  • MySQL 5.6 源码目录结构

    基于MySQL 5 6 26源码 源码目录 xff1a BUILD 构建工程的脚本 client 客户端 cmake cmd line utils 命令行工具 dbug 调试库 Docs 文档 extra 一些相对独立的次要工具 inclu
  • 计算机I/O原理

    cpu通过IO命令控制设备 xff0c cpu对设备的控制仅仅可以到达设备控制器 xff0c 无法直接控制设备 设备无法直接和cpu通信 xff0c 设备控制器通过中断机制向cpu反馈信息 即这个一个模型 CPU IO指令 gt 设备控制器
  • 计算机的I/O端口地址表

    PC的I O端口地址表 xff08 I O端口地址表 xff09 http tieba baidu com f kz 61 16042340 I O端口地址表 PC只用了10位地址线 A0 A9 进行译码 xff0c 其寻址的范围为0H 3
  • 利用pthread进行数组求和

    POSIX thread 简称为pthread xff0c Posix线程是一个 POSIX 标准线程 利用多线程可以提高运算速度 利用pthread进行数组求和的程序如下 xff1a include lt stdio h gt inclu
  • 字符串的全排列程序

    include lt iostream gt include lt cstring gt using namespace std void swap char str int i int j char tmp 61 str i str i
  • Google面试总结

    分享 Google面试总结 来源 xff1a 王冠中的日志 终于把Google的面试给搞完了 xff0c 感觉可以算是Tech Interview的顶峰了 这里主要写一下大概流程和内容 xff0c 给大家以后interview一个参考 G的
  • sql server中的注释快捷键

    sql server中的注释快捷键 注释 xff1a Ctrl 43 K Ctrl 43 C xff08 按住Ctrl 然后K C xff09 取消注释 xff1a Ctrl 43 K Ctrl 43 U xff08 按住Ctrl 然后K
  • SpringMVC统一异常处理(返回异常数据而不是跳转到某个页面的方法)

    关于SpringMVC统一异常处理的问题 xff0c 网搜一大把 网上搜的关于如何进行统一异常处理不外乎如下三种方式 xff1a Spring MVC处理异常有3种方式 xff1a 1 使用Spring MVC提供的简单异常处理器Simpl
  • Entity Framework 6.0 Code First

    目录 一 安装 Entity Framework1 安装安 EF NuGet 包2 从包管理器控制台安装 二 创建模型三 创建上下文四 读取和写入数据五 迁移 一 安装 Entity Framework 新建基于 Net Framework
  • C#中的json格式字符串解析

    如题 xff0c 根据json字符串的难易程度 xff0c C 提供的对应解析方法也不同 xff0c 现做简单的归类总结 xff1a 一 xff0c 对于最简单的json类型 xff0c 可以使用如下方法 1 使用JsonReader类 x
  • 12本Python书籍推荐

    Python是用于各种任务和领域的优秀编程语言之一 Python的用户友好性 xff0c 高级特性以及对简单性和增强代码可读性的强调使其成为全球许多开发人员的理想选择 诸如此类的功能使应用程序开发 xff0c 数据科学 xff0c 人工智能
  • VirtualBox因为强制关机,第二天启动获取 VirtualBox COM 对象失败。亲测解决方案

    唯一一次手滑就点了仍要关机 第二天小盒子直接不给启动了 获取 VirtualBox COM 对象失败 应用程序将被中断 Completely failed to instantiate CLSID VirtualBox RPC E SERV
  • Ubuntu/Deepin登陆界面输入密码无限循环进不了桌面的处理方法

    问题 xff1a 今天有用户在不知道做了什么操作 xff0c 在输入密码后就一直停在那无法登陆GUI界面了 本以为是root密码不对 xff0c 尝试了恢复root密码操作无效 然后网上搜了一堆处理方法 切换tty命令界面 因为图形界面卡死
  • 基于Linux的Microsoft Edge浏览器

    关于Edge 近年来随着浏览器市场的变革 xff0c IE的地位越来越低 xff0c 终于微软在Windows 10操作系统中推出了全新的Edge浏览器 xff0c 但是在刚开始的阶段Edge浏览器并不友好 xff0c 很多人都无法适应Ed
  • OpenEuler华为欧拉系统安装教程及联网配置

    OpenEuler简介 openEuler是一款开源操作系统 当前openEuler内核源于Linux xff0c 支持鲲鹏及其它多种处理器 xff0c 能够充分释放计算芯片的潜能 xff0c 是由全球开源贡献者构建的高效 稳定 安全的开源
  • 在Ubuntu中安装Chrome浏览器

    Chrome 简介 Google Chrome是由Google开发的一款设计简单 高效的Web浏览工具 Google Chrome的特点是简洁 快速 GoogleChrome支持多标签浏览 xff0c 每个标签页面都在独立的 沙箱 内运行
  • tomcat 报错 org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception invoking method manageApp

    报错 xff1a Caused by java lang IllegalArgumentException More than one fragment with the name log4j was found This is not l
  • Chrome拓展开发之manifest.json

    Chrome拓展开发 Chrome拓展开发之manifest json常用参数manifest编写 Chrome拓展开发之manifest json manifest json是必须存在的 xff0c 它用来配置所有和插件相关的参数 用Ch
  • -bash: *: command not found解决办法

    今天在linux上配置环境时出现 bash command not found错误 xff0c 网上找了一下 xff0c 方法如下 xff1a 如输入 ls 出现 bash ls command not found ipconfig 出现
  • 遍历句柄所有子窗口 win32gui.EnumChildWindows

    The handler span class token keyword is span indeed called span class token keyword for span each child span class token