Home > Database > Mysql Tutorial > VC++编程技巧集

VC++编程技巧集

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:42:18
Original
1388 people have browsed it

代码如下: 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++编程技巧集

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template