在多个根窗口中使用 FindWindow [英] using FindWindow with multiple root windows

查看:42
本文介绍了在多个根窗口中使用 FindWindow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在构建一个使用 win32 的 SendMessage 作为 IPC 的应用程序.

So I'm building an app that uses win32's SendMessage as IPC.

我正在使用 FindWindow 根据 className 和 windowName 获取 hWnd.在我想与与其他根 Windows 具有相同名称/类名的根窗口(如在桌面的子窗口中)交谈之前,这一切都进行得很顺利.

I'm using FindWindow to get the hWnd based on className and windowName. This has all being going fine and dandy until I want to talk to a root (as in child of the desktop) Window that has the same name / class name as other root Windows.

是否可以使用 FindWindow 的替代方法来选择我想要的 hWnd?

推荐答案

你能定位到你想要的窗口的子窗口吗?如果是这样,您可以使用 FindWindowEx 来走到根窗口.如果没有,那么您需要使用 EnumWindows 并确定哪些属性将您要查找的根窗口与具有相同标题和类的其他根窗口区分开来.

Can you locate a child window of the window you want? If so, you can use FindWindowEx to walk up to the root window. If not, then you need to use EnumWindows and determine what attributes set the root window you are looking for apart from the other root windows with the same caption and class.

这篇关于在多个根窗口中使用 FindWindow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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