.SetMapMode()
.SetWindowExt()
.SetViewportExt()
.SetWindowOrg()
.SetViewportOrg()
.LPtoDP()
.DPtoLP()
.SelectObject() // GDI 객체들을 생성 후 적용
.SelectStockObject()
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
// {
CRect rectView;
GetDlgItem(IDC_STATIC_VIEW)->GetWindowRect(&rectView);
ScreenToClient(&rectView);
// clear out structure
memset(&lf, 0, sizeof(LOGFONT));
// request a 12-pixel-height font
lf.lfHeight = 12;
// request a face name "Arial"
strcpy_s(lf.lfFaceName, LF_FACESIZE, "Arial");
// create the font
HFONT hfont = ::CreateFontIndirect(&lf);
..
// Done with the font. Delete the font object.
::DeleteObject(hfont);