如何自动关闭模态对话框? [英] How to auto close modal dialog?

查看:82
本文介绍了如何自动关闭模态对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的用例。我使用DoModal()呈现模态对话框。现在,我如何自动关闭它?

I've a simple use case. I present a modal dialog using DoModal(). Now, how do I automaticlly close it?

我尝试使用:: GetActiveWindow,DestroyWindow等,但它们似乎没有工作。我是否需要在不同的线程上调用这些API?

I tried using ::GetActiveWindow, DestroyWindow, etc., but they didn't seem to work. Do I need to call these API's on a different thread?

谢谢!

推荐答案

使用计时器。 使用EndDialog取消模态对话框。
Use a Timer.  A modal dialog is dismissed with EndDialog.


这篇关于如何自动关闭模态对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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