查找全局对话框句柄 [英] Finding Global Dialog Box Handle

查看:144
本文介绍了查找全局对话框句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用过Findwindow& findwindowEX获取对话框句柄.但是它总是返回0值.

我在Spy ++中看到此对话框不在其应有的父窗口"子树下,而是在父窗口上方,这意味着在主桌面进程"窗口的子树列表中.即使我只使用FindWindow查找对话框,我也再次得到0值.该对话框只有类名,没有窗口名.

我也已经在spy ++中检查了该对话框显示的父窗口名称及其句柄.
该对话框看起来像全局对话框,在spy ++属性窗口中提到了父窗口,但不在其父窗口的子树下.这就是为什么FindWindowEx也不返回此对话框的句柄的原因.
任何人都知道为什么findwidnow和findwindowEX在这样的对话框窗口中都不起作用.如果您有解决这类棘手的对话框窗口句柄的解决方案,请告诉我.我在项目中使用了C#.

I have used Findwindow & findwindowEX to get dialog box handle. But it''s always returning 0 value.

I saw in Spy++ that this dialog box is not under Parent window child tree where it supposed to, but it was above the parent window, means on Main Desktop Process window child tree list. Even I used only FindWindow to find dialog box, I got again 0 value in return. This dialog box has only class name, no windows name.

Also I have checked that in spy++ that this dialog box showing parent window name & it''s handle.
This dialog box look like global dialog box with having parent window mentioned in spy++ properties window, but not under child tree of his own parent window. Thats why FindWindowEx also not returning handle to this dialog box.

Anybody know why both findwidnow & findwindowEX not working on such dialog box windows. Please let me know if you have solution for getting such type of tricky dialog windows handles. I used C# for my project.

推荐答案

您可以遍历所有窗口,直到找到所需的窗口.

看看这段代码项目文章:
使用C#进行窗口隐藏 [ http://channel9.msdn.com /forums/TechOff/258171-How-to-iterate-through-ALL-Window-handles-in-C/ [
You could traverse all windows until you find the one you need.

Have a look at this codeproject article:
Window Hiding with C#[^]


or maybe something like this:

http://channel9.msdn.com/forums/TechOff/258171-How-to-iterate-through-ALL-Window-handles-in-C/[^]

Good luck!


这篇关于查找全局对话框句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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