#include class CHelloApp : public CWinApp { public: virtual BOOL InitInstance(); }; class CMainFrame : public CFrameWnd { public: CMainFrame(); protected: afx_msg void OnPaint(); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); DECLARE_MESSAGE_MAP() }; CHelloApp theApp; BOOL CHelloApp::InitInstance() { m_pMainWnd = new CMainFrame; m_pMainWnd->ShowWindow(m_nCmdShow); return TRUE; } CMainFrame::CMainFrame() { Create(NULL, _T("HelloMFC")); } void CMainFrame::OnPaint() { CPaintDC dc(this); TCHAR *msg = _T("Hello, MFC"); dc.TextOut(100,100,msg); } void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point) { MessageBox(_T("click"), _T("¸¶¿ì½º ¸Þ½ÃÁö")); } BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) ON_WM_PAINT() ON_WM_LBUTTONDOWN() END_MESSAGE_MAP()