如何自动关闭对话框 [英] How do I auto close dialog

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

问题描述

我希望在没有光标移动到对话框上5秒后关闭我的对话框。



我尝试了什么:



OnTimer();

int iclose;



iclose + = 1;

如果(iclose == 5)

this-> SetWindow(SW_HIDE);

I want to close my dialog after no movement of cursor over dialog for 5 seconds.

What I have tried:

OnTimer();
int iclose;

iclose+=1;
If(iclose==5)
this->SetWindow(SW_HIDE);

推荐答案

隐藏窗口将隐藏对话框但不关闭它。 要关闭对话框,请致电 CDialog: :EndDialog [ ^ ]。



当然,你还必须编写逻辑来定期检查是否在结束对话之前已经过了适当的时间。



/ ravi
Hiding the window will hide the dialog but not close it.  To close the dialog, call CDialog::EndDialog[^].

Of course, you also have to write the logic to periodically check if the appropriate time has elapsed before you end the dialog.

/ravi


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

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