Visual C++ 时尚编程百例001

在客户区指定位置显示一字符串

CRect r;//创建矩形对象

GetClientRect(&r);//获取窗口大小

int x=r.right/2,y=r.bottom/2;

pDC->SetTextAlign(TA_CENTER|TA_BASELINE);

pDC->TextOut(x,y,_T("hello"));