《C语言实例教程(PDF格式)》第97章


运算符将得不到正确的结果;出于同样的原因,如果是使用 “GetTextMetrics(&tm);
// 获得当前客户区的大小
CRect rect;
GetClientRect(&rect);
pDC…》DPtoLP(&rect);
// 每行平均字符数
int cpl=rect。Width()/tm。tmAveCharWidth;
// 每行字符高度
int h=int(tm。tmHeight*1。5);
int cl=0; // 所显示的总行数; 用来计算文本的输出位置
for (int i=0; iGetTabbedTextExtent(pHead;
int(pCur…pHead); 0; NULL)。cx》rect。Width())

pCur=_tcsdec(pHead;pCur);

// 在客户区绘制文本
pDC…》TabbedTextOut(0; (cl++)*h;
pHead; int(pCur…pHead); 0; NULL; 0);

pHead=pCur;
}while(pCur
小说推荐
返回首页返回目录