16,471
社区成员
发帖
与我相关
我的任务
分享
#include<afxwin.h>
class CMyWinApp : public CWinApp
{
public:
BOOL InitInstance();
};
class CMainWindow : public CFrameWnd
{
public:
CMainWindow();
afx_msg void OnLButtonDown(UINT,CPoint);
afx_msg void OnPaint();
CEdit edit;
DECLARE_MESSAGE_MAP()
};
#include<afxwin.h>
#include"w.h"
CMyWinApp theApp;
BEGIN_MESSAGE_MAP(CMainWindow, CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_PAINT()
END_MESSAGE_MAP()
BOOL CMyWinApp::InitInstance ()
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow (SW_SHOW);
m_pMainWnd->UpdateWindow ();
return TRUE;
}
CMainWindow::CMainWindow ()
{
Create(0,L"");
CRect r;
r.top =10;r.left =10;r.right =110;r.bottom =110;
edit.Create (WS_VISIBLE | WS_CHILD, r,this,555);
}
void CMainWindow::OnLButtonDown (UINT,CPoint)
{
}
void CMainWindow::OnPaint ()
{
CClientDC dc(this);
dc.FillSolidRect (0,RGB(100,100,100));
}