분류 전체보기
-
Animation - MFCGUI/GDI 2008. 12. 10. 01:37
class CPractice7_2View : public CView { ... protected: // Generated message map functions protected: //{{AFX_MSG(CPractice7_2View) ... afx_msg void OnAnimationStart(); afx_msg void OnAnimationStop(); afx_msg void OnTimer(UINT nIDEvent); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: static int bitmap_inc; // 애니메이션 카운터 증가변수 void ShowCharacter( ); int m_nBitmapMode; }; int CPractice7_2View::bitmap_inc..
-
비트맵 - MFCGUI/GDI 2008. 12. 10. 01:18
MFC는 DIB를 지원하지 않는다. CBitmap .CreateBitmap() .LoadBitmap() .CreateCompatibleBitmap() CWnd .GetDesktopWindow() CDC .CreateCompatibleDC() .SelectObject() .BitBlt() SRCCOPY|SRCAND|SRCPAINT CClientDC -> CDC CWindowDC -> CDC void CMemDrawView::OnDraw(CDC* pDC) { CBitmap bmpBuffer; CDC BufferDC; BufferDC.CreateCompatibleDC(pDC); bmpBuffer.CreateCompatibleBitmap(pDC, 200, 200); CBitmap *pOldBitmap = (CB..
-
툴바 - MFCGUI/컨트롤 2008. 12. 8. 20:35
CFrameWnd -> CWnd .EnableDocking() CBRS_ALIGN_ANY .DockControlBar() AFX_IDW_DOCKBAR_BOTTOM AFX_IDW_DOCKBAR_LEFT. .FloatControlBar() .LoadBarState() .SaveBarState() CControlBar -> CWnd GetWindowRect(rcChild); ScreenToClient(rcChild); rcChild.OffsetRect(ptOffset); pwndChild->MoveWindow(rcChild, FALSE); pwndChild = pwndChild->GetNextWindow(); } CRect rcWindow; GetWindowRect(rcWindow); rcWindow.righ..
-
CWinAppMFC 2008. 12. 8. 18:06
AfxGetInstanceHandle() CWinApp (OnFileNew) // ID_FILE_NEW CDocument::OnNewDocument (OnFileSave, OnFileSaveAs) // ID_FILE_SAVE, ID_FILE_SAVE_AS CDocument::OnOpenDocument (OnFileOpen) // ID_FILE_OPEN CDocument::OnOpenDocument ::AfxGetApp() m_lpCmdLine .OpenDocumentFile() .SetRegistryKey() HKEY_CURRENT\USER\Software\{..}\{실행 파일의 이름} .WriteProfileInt() HKEY_CURRENT\USER\Software\{..}\{실행 파일의 이름}\{....
-
키보드/마우스 버튼 - MFCGUI/컨트롤 2008. 12. 8. 18:02
CWnd WM_CHAR VK_BACK WM_KEYDOWN VK_LEFT VK_RIGHT VK_UP VK_DOWN VK_PRIOR VK_NEXT VK_HOME class CPractice3_3View : public CView { // { CPoint m_ptNow; CString m_strOutText; // } protected: // create from serialization only CPractice3_3View(); ... // Generated message map functions protected: //{{AFX_MSG(CPractice3_3View) afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnKe..
-
스플리터(정적 분할 윈도우) - MFCGUI/컨트롤 2008. 12. 8. 17:10
CSplitterWnd .CreateStatic() .CreateView() .SetRowInfo() .GetPane() class CMainFrame : public CFrameWnd { ... // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMainFrame) ... protected: virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext); //}}AFX_VIRTUAL ... private: CSplitterWnd m_wndSplit; // 멤버 변수 등록 }; BOOL CMainFrame::OnCreateClient(LPC..
-
Multi View - SDIMFC 2008. 12. 8. 16:57
class CMainFrame : public CFrameWnd { ... // Generated message map functions protected: //{{AFX_MSG(CMainFrame) afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnViewChange(); //}}AFX_MSG DECLARE_MESSAGE_MAP() // { private: void SecondView(); void FirstView(); int m_nViewFlag; enum {FIRSTVIEW=1, SECONDVIEW}; CPractice10_3View *m_pFirstView; // 두개의 뷰 클래스 에 대한 CSecondView *m_pSec..
-
직렬화 - MFC스트림 IO/기타 2008. 12. 7. 18:40
CArchive CMemFile, CSocketFile 클래스와 연결될 수 있다 CObject를 상속한 객체의 .Serialize()에 인자로 넘겨주면 해당 객체가 스스로(?) 직렬화한다. CArchive() CArchive::store|CArchive::load .Read() .Write() .ReadString() .WriteString() .IsStoring() .() m_z; } CArchive& AFXAPI operator(CArchive& ar, CPoint3D& point) { point.Serialize(ar); return ar; } void main() { TRY // 쓰기 { CPoint3D point(10, 20, 30); CFile file; file.Open(_T("File.da..