首页 >数据库 >mysql教程 >VC++编程技巧集

VC++编程技巧集

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-07 15:42:181388浏览

代码如下: 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) ); pD

代码如下:

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);
}

截图如下:

VC++编程技巧集

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn