Fundamental Notes/MFC MFC : 타이틀바에 콩콩댕 2009. 10. 6. 11:03 반응형 MainFrm.cpp : implementation of the CMainFrame class//#include "stdafx.h"#include "1006.h"#include "MainFrm.h"#include <afxtempl.h>#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CMainFrameIMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) //{{AFX_MSG_MAP(CMainFrame) ON_WM_SETFOCUS() ON_WM_CREATE() ON_WM_SIZE() //}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CMainFrame construction/destructionCMainFrame::CMainFrame(){ // TODO: add member initialization code here }CMainFrame::~CMainFrame(){}BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs){ if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.dwExStyle &= ~WS_EX_CLIENTEDGE; cs.lpszClass = AfxRegisterWndClass(0); return TRUE;}/////////////////////////////////////////////////////////////////////////////// CMainFrame diagnostics#ifdef _DEBUGvoid CMainFrame::AssertValid() const{ CFrameWnd::AssertValid();}void CMainFrame::Dump(CDumpContext& dc) const{ CFrameWnd::Dump(dc);}#endif //_DEBUG/////////////////////////////////////////////////////////////////////////////// CMainFrame message handlersvoid CMainFrame::OnSetFocus(CWnd* pOldWnd){ // forward focus to the view window m_wndView.SetFocus();}BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo){ // let the view have first crack at the command if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) return TRUE; // otherwise, do default handling return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);}int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here if(!m_wndView.Create(NULL,NULL,AFX_WS_DEFAULT_VIEW,CRect(0,0,0,0), this, AFX_IDW_PANE_FIRST,NULL)) { TRACE0("faild\n"); return -1; } return 0;}void CMainFrame::OnSize(UINT nType, int cx, int cy) { CFrameWnd::OnSize(nType, cx, cy); // TODO: Add your message handler code here CWindowDC dc(this); dc.Ellipse(80,5,100,20); dc.Ellipse(120,5,140,20); dc.TextOut(160,5,CString("여기는 타이틀바입니다.")); } 저작자표시 비영리 변경금지 (새창열림)