// PhoneComing.cpp : implementation file // #include "stdafx.h" #include "uphonebox.h" #include "PhoneComing.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // PhoneComing dialog PhoneComing::PhoneComing(CWnd* pParent /*=NULL*/) : CDialog(PhoneComing::IDD, pParent) { //{{AFX_DATA_INIT(PhoneComing) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void PhoneComing::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(PhoneComing) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(PhoneComing, CDialog) //{{AFX_MSG_MAP(PhoneComing) ON_WM_TIMER() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // PhoneComing message handlers void PhoneComing::SetText(int line, CString str) { CString ss; ss.Format("Ïß·: %d À´µç", line + 1); SetDlgItemText(IDC_STATIC1, ss); SetDlgItemText(IDC_STATIC2, str); SetTimer(1, 10000, NULL); m_tick = ::GetTickCount(); } void PhoneComing::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default KillTimer(1); ShowWindow(SW_HIDE); CDialog::OnTimer(nIDEvent); } BOOL PhoneComing::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void PhoneComing::CheckTimer() { KillTimer(1); if (::GetTickCount() - m_tick > 2000) ShowWindow(SW_HIDE); else { SetTimer(1, 2000, NULL); } }