// TODO: 在此添加控件通知处理程序代码
CDC* pDC = new CDC();
//产生字体
CFont font;
font.CreateFont(14,0,0,900,FW_NORMAL,0,0,0,ANSI_CHARSET,OUT_TT_PRECIS,CLIP_TT_ALWAYS,PROOF_QUALITY,VARIABLE_PITCH|FF_ROMAN,_T("新宋体"));
//第一个是字号大小,第三个是字体方向
//创建屏幕DC
pDC->CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
//将字体选进DC中
CFont* pOldFont = pDC-> SelectObject(&font);
//设置背景模式
pDC->SetBkMode(TRANSPARENT);
//设置文本对齐方式
pDC->SetTextAlign(TA_CENTER);
//获得屏幕长度和高度
int cx = GetSystemMetrics(SM_CXSCREEN);
int cy = GetSystemMetrics(SM_CYSCREEN);
//在屏幕输出文本
pDC->TextOut(cx / 2, cy / 2 - 40, _T("Hello World!你个王八蛋!"));
delete pDC;
转载于:https://www.cnblogs.com/rogee/archive/2011/04/02/2004095.html