SetIconm_hIcon FALSE // Set small icon // TODO: Add extra initialization here // // SetTimer1900NULL//这个函数设置一个系统定时器。
指定了一个定时值每当发生超时则系统就向设置定时器的应用程序的消息队列发送一个WM_TIMER消息或者将消息传递给应用程序定义的TimerProc回调函数。
return TRUE // return TRUE unless you set the focus to a control void CClock111Dlg::OnSysCommandUINT nID LPARAM lParam 程序设计课程设计 年级 班 学号姓名 9 if nID 0xFFF0 IDM_ABOUTBOX CAboutDlg dlgAbout dlgAbout.DoModal else CDialog::OnSysCommandnID lParam // If you add a minimize button to your dialog you will need the code below // to draw the icon. For MFC applications using the document/view model // this is automatically done for you by the framework. void CClock111Dlg::OnPaint if IsIconic 程序设计课程设计 年级 班 学号姓名 10 CPaintDC dcthis // device context for painting SendMessageWM_ICONERASEBKGND WPARAM dc.GetSafeHdc 0 // Center icon in client rectangle int cxIcon GetSystemMetricsSM_CXICON int cyIcon GetSystemMetricsSM_CYICON CRect rect GetClientRectrect int x rect.Width - cxIcon 1 / 2 int y rect.Height - cyIcon 1 / 2 // Draw the icon dc.DrawIconx y m_hIcon else CDialog::OnPaint 程序设计课程设计 年级 班 学号姓名 11 // The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CClock111Dlg::OnQueryDragIcon return HCURSOR m_hIcon void CClock111Dlg::OnChangeYear // TODO: If this is a RICHEDIT control the control will not // send this notification unless you override the CDialog::OnInitDialog // function and call CRichEditCtrl.SetEventask. // with the ENM_CHANGE flag ORed into the m // TODO: Add your control notification handler code here SYSTEMTIME sys GetLocalTime sys m_year.Formatd 年 sys.wYear UpdateDatafalse 程序设计课程设计 年级 班 学号姓名 12 void CClock111Dlg::OnChangeMonth // TODO: If this is a RICHEDIT control the control will not // send this notification unless you override the CDialog::OnInitDialog // function and call CRichEditCtrl.SetEventMask // with the ENM_CHANGE flag ORed into the mask. // TODO: Add your control notification handler code here SYSTEMTIME sys GetLocalTime sys m_month.Formatd 月 sys.wMonth UpdateDatafalse void CClock111Dlg::OnChangeDay // TODO: If this is a RICHEDIT control the control will not // send this notification unless you override the CDialog::OnInitDialog // function and call CRichEditCtrl.SetEventMask 程序设计课程设计 年级 班 学号姓名 13 // with the ENM_CHANGE flag ORed into the mask. // TODO: Add your control notification handler code here SYSTEMTIME sys GetLocalTime sys m_day.Formatd 日 sys.wDay UpdateDatafalse include include void CClock111Dlg::OnTimerUINT nIDEvent // TODO: Add your message handler code here and/or call default RedrawWindow CTime time time CTime::GetCurrentTime CDC pDC GetDC 程序设计课程设计 年级 班 学号姓名 14 CPen oldpen pen1pen2pen3pen4pen5pen6 CPen pen11pen22pen33 pen1.CreatePenPS_SOLID2RGB20000 pen4.CreatePenPS_SOLID2RGB20000 pen11.CreatePenPS_SOLID2RGB20000 pen2.CreatePenPS_SOLID4RGB100100200 pen22.CreatePenPS_SOLID2RGB100100200 pen5.CreatePenPS_SOLID5RGB100100200 pen3.CreatePenPS_SOLID6RGB000 pen33.CreatePenPS_SOLID3RGB000 pen6.CreatePenPS_SOLID8RGB000 double pi 3.141592653 double Rad double r double x doub