20 likes | 172 Views
Simple GUI Programs with the Microsoft Foundation Classes. CFrameWnd. YourFrame. focus of your effort is here. CWinApp. YourApp. #define WINVER 0x400 // ok for Win2K or later #include <afxwin.h> // MFC header. class YourFrame : public CFrameWnd { public:
E N D
Simple GUI Programs with the Microsoft Foundation Classes CFrameWnd YourFrame focus of your effort is here CWinApp YourApp #define WINVER 0x400 // ok for Win2K or later #include <afxwin.h> // MFC header class YourFrame : public CFrameWnd { public: YourFrame() { Create( NULL, "Caption" ) ; /*...*/} private: // data and helper functions here protected: // message handlers void OnPaint() { /*...*/ } void OnLButtonDown( UINT flags, CPoint pt ) { /*...*/ } DECLARE_MESSAGE_MAP() } ; BEGIN_MESSAGE_MAP( YourFrame, CFrameWnd ) ON_WM_PAINT() ON_WM_LBUTTONDOWN() END_MESSAGE_MAP() struct YourApp : public CWinApp { virtual BOOL InitInstance() { m_pMainWnd= new YourFrame ; m_pMainWnd->ShowWindow( m_nCmdShow ) ; m_pMainWnd->UpdateWindow() ; return true ; } } ; YourApp yourApp ; NKU CSC 402 Kirby