1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
HDC hdc=GetDC(hWnd);
RECT rc={5,10,120,400};
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
SetBkMode(hdc,TRANSPARENT);
SetTextColor(hdc,RGB(0,0,0));
long fHeight=-MulDiv(12,GetDeviceCaps(hdc,LOGPIXELSY),72);
HFONT hF=CreateFont(fHeight,0,0,0,FW_NORMAL,0,0,0,0,0,0,0,0,L"Times New Roman");
HGDIOBJ hPrevFont=SelectObject(hdc,(HGDIOBJ)hF);
for(int i=0;i<27;i++)
{
if(rc.top+25>=400)
{
rc.top=10;
rc.left+=250;
rc.right=rc.left+120;
}
wstring str=props[i].first;
DrawText(hdc,str.c_str(),str.length(),&rc,DT_CENTER|DT_WORDBREAK);
rc.top+=25;
}
SelectObject(hdc,hPrevFont);
ReleaseDC(hWnd,hdc);
|