반응형
CString getWindowType(){
OSVERSIONINFOEX osvi;
BOOL bOsVersionInfoEx;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
{
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) )
return L"WinXP";
}
switch (osvi.dwPlatformId)
{
case VER_PLATFORM_WIN32_NT:
if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1 )//printf("Microsoft Windows 7 / Vista ");
return L"Win7/VISTA";
else if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )//printf ("Microsoft Windows Server 2003, ");
return L"WinServer2003";
else if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )//printf ("Microsoft Windows XP ");
return L"WinXP";
else if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )//printf ("Microsoft Windows 2000 ");
return L"Win2000";
else if ( osvi.dwMajorVersion <= 4 )//printf("Microsoft Windows NT ");
return L"WinNT";
break;
case VER_PLATFORM_WIN32_WINDOWS:
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)//printf ("Microsoft Windows 95 ");
return L"Win95";
else if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)//printf ("Microsoft Windows 98 ");
return L"Win98";
else if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)//printf ("Microsoft Windows Millennium Edition\n");
return L"WinME";
break;
case VER_PLATFORM_WIN32s:
return L"Win32";
break;
}
}
반응형
'개발자이야기 > VC++' 카테고리의 다른 글
NI I/O Device Simulator Program Development 자료 (0) | 2011.03.08 |
---|---|
VC++ HWND 윈도우 핸들로 새로고침 하기 (0) | 2011.03.08 |
vc++ 윈도우 구분 소스 (0) | 2011.02.24 |
ShellExecute 함수의 여러가지 사용법에 대하여... (0) | 2011.02.23 |
IE 컨트롤 (0) | 2011.02.23 |