[英]How to find number of windows with the same title bar or class?
我正在尝试获取运行特定 windows 类/标题的 windows 数量的 integer 值。 有没有 function 可以做到这一点? 我试过FindWindow
但它似乎没有通过所有 windows go。
我正在尝试做的一个例子是找到用户使用“Visual Studio”class 打开的 Windows 的数量。
通过将句柄传递给每个 window,依次传递给应用程序定义的回调 function,在屏幕上枚举所有顶级windows。
您可以使用GetClassName 、 GetWindowText分别检索 class 的名称和指定窗口标题栏的文本。 请参阅ScreenCaptureforHWND示例。
对于其他人,正如@IInspectable 所说,使用EnumChildWindows 。 但就 Visual Studio 而言, EnumWindows就足够了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.