需要对话框句柄的集合 [英] Need a collection of Dialog handles

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

问题描述

我有一个C#程序,它监视另一个应用程序(进程),并且在关闭Dialog时需要采取行动.

我的程序:

-在另一个应用程序中调用保存对话框
-一个对话框打开,说明正在保存信息
-我正在循环播放,需要知道该对话框何时关闭(即保存完成)

目前,我使用以下内容,但由于名称不同,它不起作用.

fileDialog = FindWindow(#32770",下载完成");

该对话框具有变量名,所以我认为我需要做的是

-调用查找所有对话框"窗口的方法#32770
-然后我可以对它们进行计数,并且当计数减少一时,我可以假定已完成,或者可以检查名称并查找文本的子集.

我是WinAPI的新手,所以如果有人可以给我一个不错的代码段,那就太好了.

我已经阅读了许多网页,但并没有真正理解解决方案.

在此先感谢您,并度过了一个愉快的周末.

解决方案

请在这里参考:http://pinvoke.net/default.aspx/user32/EnumWindows.html

I have a c# program that watches another application(process) and needs to act when a Dialog is closed.

My program :

- calls a save dialog in another app
- a dialog window opens saying info is being saved
- I am looping and need to know when this dialog closes (ie save is complete)

Currently I use the following but it does not work as the name varies.

fileDialog = FindWindow("#32770", "Download complete");

The dialog has variable names so what I think I need to do is to

- Call a method to Find All Dialog Windows #32770
- I can then either count them and when count decreases by one I can assume completion OR I can check the names and look for a subset of text.

I am new to WinAPI so if anyone can give me a decent code snippet then that would be great.

I have read many web pages but have not really understood the solutions.

Thanks in advance and have a great weekend.

解决方案

Please refer here :http://pinvoke.net/default.aspx/user32/EnumWindows.html


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

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