代码如下:
void csys1view::ondraw(cdc* pdc)
{
csys1doc* pdoc = getdocument();
assert_valid(pdoc);
// todo: add draw code for native data here
// 显示系统windows目录
wchar szpath[max_path];
getwindowsdirectoryw( szpath, sizeof(szpath) );
pdc->textout(100,100,windows目录:);
pdc->textout(250,100,szpath);
// 显示temp目录
char temppath[_max_path+1];
::gettemppath (_max_path,temppath);
pdc->textout(100,150,temp目录:);
pdc->textout(250,150,temppath);
// 显示系统分辨率
char a1[12],b1[12];
csize sizescreen (getsystemmetrics (sm_cxscreen),
getsystemmetrics (sm_cyscreen));
itoa(sizescreen.cx,a1,10);
itoa(sizescreen.cy,b1,10);
pdc->textout(100,200,水平分辨率:);
pdc->textout(100,225,垂直分辨率:);
pdc->textout(250,200,a1);
pdc->textout(250,225,b1);
}
截图如下:
