64,646
社区成员
发帖
与我相关
我的任务
分享
class CMyApp:public CWinApp
{
public:
virtual BOOL InitInstance();
};
class CMyFrame: public CFrameWnd
{
public:
CMyFrame();
protected:
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP();
};
#include <afxwin.h>
#include "app.h"
CMyApp theApp;
BOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMyFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(CMyFrame, CFrameWnd)
ON_WM_LBUTTONWODN()
ON_WM_PAINT()
END_MESSAGE_MAP()
CMyFrame::CMyFrame()
{
Create(NULL, "MYAPP Application");
}
void CMyFrame::OnLButtonDown(UINT nFlags, CPoint point)
{
TRACE("Entering CMyFrame::OnLButtonDown - %1x, %d, %d\n",
(long) nFlags, point.x,point.y);
}
void CMyFrame::OnPaint()
{
CPaintDC dc(this);
dc.TextOut(0, 0, "Hello,World!");
}