Hi, I have an ActiveX digital clock and the following code is in the OnDraw()
function:
HRESULT OnDraw(ATL_DRAWINFO& di)
{
RECT& rc = *(RECT*)di.prcBounds;
HBRUSH hBrush, hOldBrush;
hBrush = (HBRUSH)GetStockObject(WHITE_BRUSH);
hOldBrush = (HBRUSH)SelectObject(di.hdcDraw, hBrush);
Rectangle(
di.hdcDraw,
rc.left,
rc.top,
rc.right,
rc.bottom);
SelectObject(di.hdcDraw, hOldBrush);
TCHAR pszText[10];
wsprintf(pszText, _T("%02d:%02d:%02d"),
m_sHour, m_sMinute, m_sSecond);
DrawText(
di.hdcDraw,
pszText,
-1,
&rc,
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
return S_OK;
}
How can I change the font and size so that I can change the appearance of
the clock?
Thanks for any help you guys can give me.