检测另一个进程的模式对话框(Detecting a modal dialog box of another process)

编程入门 行业动态 更新时间:2024-10-27 03:34:44
检测另一个进程的模式对话框(Detecting a modal dialog box of another process)

我想检测另一个进程是否说process.exe当前正在显示一个对话框? 有没有办法在C#中做到这一点?

看看我是否可以获得对话框的句柄。 我尝试过Spy ++的查找窗口工具,当我尝试在对话框顶部拖动取景器时,它不会突出显示对话框,而是填充详细信息并提及AppCustomDialogBox并提及句柄编号

请告知我如何以编程方式检测到..

谢谢,

I want to detect whether another process say process.exe is currently displaying a dialog box ? Is there a way to do that in C# ?

To see if I could get the handle of the dialog box. I have tried Spy++ 's find window tool, when I try to drag the finder on top of the dialog box, it does not highlight the dialogbox but populates the details and mentions AppCustomDialogBox and mentions the handle number

Please advise how can I programatically detect that ..

Thanks,

最满意答案

由于模态对话框通常会禁用父窗口,因此您可以枚举进程的所有顶级窗口,并查看是否使用IsWindowEnabled()函数启用它们。

As modal dialogs normally disable the parent window(s), you can enumerate all top level windows for a process and see if they're enabled using the IsWindowEnabled() function.

更多推荐

本文发布于:2023-08-01 07:55:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1356767.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对话框   进程   模式   Detecting   process

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!