如题,对话框上没有任何的按钮,只能有程序定时来关闭它,在OnTimer()函数里要怎么写?
在OnTimer()里给它发个结束的消息。
计算或设置时间,
然后判断是否到,
然后用这个对话框的对象
this->PostMessage(WM_CLOSE,0,0);
来关闭。
类似:
CTime t1( 3, 19, 22, 15, 0 );
CTime t2( 3, 20, 22, 15, 0 );
CTimeSpan ts = t2 - t1; // Subtract 2 CTimes
ASSERT( ts.GetTotalSeconds() == 86400L );
换成
if( ts.GetTotalSeconds() == 86400L );
this->PostMessage(WM_CLOSE,0,0);
SendMessage