MFC时钟程序C++源代码
背景类源代码:
CClockBackground::~CClockBackground()
{
}
void CClockBackground::Draw(CDC *pDC)
{
CPen penMain(PS_SOLID, 1, m_crMain), penOther(PS_SOLID, 1, m_crOther);
CBrush brMain(m_crMain), brOther(m_crOther);
CPen *pOldPen = pDC->SelectObject(&penOther);
CBrush *pOldBrush = pDC->SelectObject(&brMain);
CPoint ptCenter = m_rcRegion.CenterPoint();
int nRadius = m_nRadius - 8;
for(int i = 0; i Ellipse(rcDot);
}
pDC -> SelectObject(&penMain);
pOldBrush = pDC -> SelectObject(&brOther);
for(i = 0; i Rectangle(rcDot);
}
pDC -> SelectObject(pOldPen);
pDC -> SelectObject(pOldBrush);
}
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 233968 2013-08-07 17:19 ClockClock.aps
文件 1186 2013-08-07 17:19 ClockClock.clw
文件 2049 2013-08-07 14:07 ClockClock.cpp
文件 5026 2013-08-07 17:43 ClockClock.dsp
文件 535 2013-08-07 14:07 ClockClock.dsw
文件 1313 2013-08-07 14:07 ClockClock.h
文件 74752 2013-08-07 18:09 ClockClock.ncb
文件 52736 2013-08-07 18:09 ClockClock.opt
文件 1778 2013-08-07 17:43 ClockClock.plg
文件 5210 2013-08-07 17:31 ClockClock.rc
文件 1661 2013-08-07 15:39 ClockClockBackground.cpp
文件 647 2013-08-07 15:14 ClockClockBackground.h
文件 4121 2013-08-07 17:31 ClockClockDlg.cpp
文件 1318 2013-08-07 16:46 ClockClockDlg.h
文件 1059 2013-08-07 14:43 ClockClockElement.cpp
文件 857 2013-08-07 14:31 ClockClockElement.h
文件 2228 2013-08-07 16:57 ClockClockEx.cpp
文件 1518 2013-08-07 16:40 ClockClockEx.h
文件 1760 2013-08-07 17:43 ClockClockHourHand.cpp
文件 631 2013-08-07 15:16 ClockClockHourHand.h
文件 1707 2013-08-07 17:43 ClockClockMinHand.cpp
文件 623 2013-08-07 15:42 ClockClockMinHand.h
文件 1072 2013-08-07 17:42 ClockClockSecHand.cpp
文件 625 2013-08-07 16:08 ClockClockSecHand.h
文件 3695616 2013-08-07 17:43 ClockDebugClock.bsc
文件 114746 2013-08-07 17:43 ClockDebugClock.exe
文件 297624 2013-08-07 17:43 ClockDebugClock.ilk
文件 13819 2013-08-07 16:46 ClockDebugClock.obj
文件 6934964 2013-08-07 16:06 ClockDebugClock.pch
文件 443392 2013-08-07 17:43 ClockDebugClock.pdb
............此处省略33个文件信息
// Clock.cpp : Defines the class behaviors for the application.
//
#include “stdafx.h“
#include “Clock.h“
#include “ClockDlg.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CClockApp
BEGIN_MESSAGE_MAP(CClockApp CWinApp)
//{{AFX_MSG_MAP(CClockApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CClockApp construction
CClockApp::CClockApp()
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CClockApp object
CClockApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CClockApp initialization
BOOL CClockApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CClockDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed return FALSE so that we exit the
// application rather than start the application‘s message pump.
return FALSE;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 233968 2013-08-07 17:19 ClockClock.aps
文件 1186 2013-08-07 17:19 ClockClock.clw
文件 2049 2013-08-07 14:07 ClockClock.cpp
文件 5026 2013-08-07 17:43 ClockClock.dsp
文件 535 2013-08-07 14:07 ClockClock.dsw
文件 1313 2013-08-07 14:07 ClockClock.h
文件 74752 2013-08-07 18:09 ClockClock.ncb
文件 52736 2013-08-07 18:09 ClockClock.opt
文件 1778 2013-08-07 17:43 ClockClock.plg
文件 5210 2013-08-07 17:31 ClockClock.rc
文件 1661 2013-08-07 15:39 ClockClockBackground.cpp
文件 647 2013-08-07 15:14 ClockClockBackground.h
文件 4121 2013-08-07 17:31 ClockClockDlg.cpp
文件 1318 2013-08-07 16:46 ClockClockDlg.h
文件 1059 2013-08-07 14:43 ClockClockElement.cpp
文件 857 2013-08-07 14:31 ClockClockElement.h
文件 2228 2013-08-07 16:57 ClockClockEx.cpp
文件 1518 2013-08-07 16:40 ClockClockEx.h
文件 1760 2013-08-07 17:43 ClockClockHourHand.cpp
文件 631 2013-08-07 15:16 ClockClockHourHand.h
文件 1707 2013-08-07 17:43 ClockClockMinHand.cpp
文件 623 2013-08-07 15:42 ClockClockMinHand.h
文件 1072 2013-08-07 17:42 ClockClockSecHand.cpp
文件 625 2013-08-07 16:08 ClockClockSecHand.h
文件 3695616 2013-08-07 17:43 ClockDebugClock.bsc
文件 114746 2013-08-07 17:43 ClockDebugClock.exe
文件 297624 2013-08-07 17:43 ClockDebugClock.ilk
文件 13819 2013-08-07 16:46 ClockDebugClock.obj
文件 6934964 2013-08-07 16:06 ClockDebugClock.pch
文件 443392 2013-08-07 17:43 ClockDebugClock.pdb
............此处省略33个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)