mfc_custom_window - 8BitsCoding/RobotMentor GitHub Wiki
ํด๋์ค ๋ง๋ฒ์ฌ -> ํด๋์ค ์ถ๊ฐ -> MFC ํด๋์ค

// Dlg.h
#include "UserWnd.h"
private:
UserWnd m_user_w;
// Dlg.cpp
// OnInitDialog()
CRect r;
r.SetRest(50, 50, 200, 200);
m_user_w.Create(NULL, NULL, WS_VISIBLE | WS_CHILD | WS_VORDER, r, this, 25000);

์๋์ฐ์ ์๋ก ๊ทธ๋ ค๋ณด์
ํด๋์ค ๋ง๋ฒ์ฌ -> WM_PAINT ์์ฑ

// OnPaint()
CPaintDC dc(this);
CRect r;
GetClientRect(r);
dc.FillSolidRect(r, RGB(0, 0, 255));

ํด๋ฆญ์ด ๋๋ฉด ๋นจ๊ฐ์์ผ๋ก ๋ณ๊ฒฝ
ํด๋์ค ๋ง๋ฒ์ฌ -> WM_LBUTTON_DOWN
// OnLButtonDownn
{
CRect r;
r.SetRect(point.x - 10, point.y - 10, point + 10, point.y + 10);
CClientDC dc(this);
dc.FillSolidRect(r, RGB(255, 0, 0,));
}