Click to See Complete Forum and Search --> : Win95 or NT?! (how to find out!)


Ronny Guenther
April 8th, 1999, 05:31 PM
My question is if there is a reliable way to say wheather my application is
currently running on NT, Win95 or Win98

Thanx for your help!

Ronny

PeterK
April 8th, 1999, 06:24 PM
Try this:

// NT 5.0 will require a different structure OSVERSIONINFOEX
OSVERSIONINFO verInfo;
ZeroMemory(&verInfo, sizeof(verInfo));
verInfo.dwOSVersionInfoSize = sizeof(verInfo);

// find out if running on NT or WIN95
if (GetVersionEx(&verInfo) == 0)
{
WFSShowLastError("Error", "Unable to retrieve Operating System information.", "", GetLastError());

}
else
{

// WIN95 or WIN98
if (verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
{
// do something
}
else if (verInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
// something
}