Click to See Complete Forum and Search --> : Win95,98 or NT?
Tonio
April 6th, 1999, 09:55 PM
Good Day!
How will I programmatically determine the platform (Win95,98 or NT)
where my app is currently running? Thanks in advance.
Martin Speiser
April 7th, 1999, 02:16 AM
Hi Tonio,
you can use GetVersionEx to get the OS including version and build number.
HTH
Martin
Candan
April 7th, 1999, 03:29 AM
OSVERSIONINFO osv;
osv.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
CString WindowsPlatform;
if (GetVersionEx(&osv))
{
// note: szCSDVersion = service pack release
CString ServiceRelease = osv.szCSDVersion;
switch(osv.dwPlatformId)
{
case VER_PLATFORM_WIN32s: //Win32s on Windows 3.1.
WindowsPlatform = "MicrosoftR Windows 3.1(TM)";
break;
case VER_PLATFORM_WIN32_WINDOWS: //WIN32 on 95 or 98
//determine if Win95 or Win98
if (osv.dwMinorVersion == 0)
{
WindowsPlatform = "MicrosoftR Windows 95(TM) " + ServiceRelease;
}
else
{
WindowsPlatform = "MicrosoftR Windows 98(TM) " + ServiceRelease;
}
break;
case VER_PLATFORM_WIN32_NT: //Win32 on Windows NT.
WindowsPlatform = "MicrosoftR Windows NT(TM) " + ServiceRelease;
break;
default:
AfxMessageBox("Failed to get correct Operating System.", MB_OK);
} //end switch
} //end if
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.