C++多显示器 - 查找所有可见/打开的窗口
我试图找到所有打开的任何类型的窗口(并且有一个任务栏“按钮”)。
我可以毫无问题地找到列表进程/hWnd,然后循环浏览它们,但是如何确定进程/hwnd 是否打开了一个窗口? (即使最小化)。
我尝试过对窗口参数进行不同的组合(例如 WS_POPUP 等),但我找到的所有参数(或参数组合)都不会在没有某种误报的情况下为我提供所有打开的窗口。作为误报的一个例子,它为我提供了两个用于 google talk 的“窗口”(即使其中一个是打开的)。另一个误报是将开始菜单视为打开的窗口。
有什么想法吗?解决方案?我已经为此工作了一段时间,它让我有点疯狂。
注意:我正在为 Windows 7 执行此操作(此时)。我不确定 XP 和 7 之间的执行方式是否有任何差异,但我认为这可能是相关的。
I'm trying to find all the windows of ANY kind that are open (and have a taskbar 'button').
I have no problems finding the list processes/hWnd's, and then cycling through those, but how do I determine if a process/hwnd has a window open? (even if minimized).
I've tried doing different combinations of the window parameters (such as WS_POPUP etc) but none of the parameters (or combinations of parameters) that I could find would give me all the open windows without some sort of false positives. As an example of a false positive was the fact that it gives me two 'windows' for google talk (even though one was open). Another false positive is considering the start menu as an open window.
Any ideas? Solutions? I've been working on this for a while and its been driving me a bit insane.
Note: I'm doing this for windows 7 (at this point). I'm not sure if there's any difference between how you would do this between XP and 7, but I thought it might be relevant.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你能使用 EnumWindows() 吗?这只找到顶层窗口。
EnumWindows (MSDN)
Can you use EnumWindows()? That finds only toplevel windows.
EnumWindows (MSDN)