OSVERSIONINFO OSVersionInfo;
OSVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&OSVersionInfo);
if (OSVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT
&& OSVersionInfo.dwMajorVersion == 5
&& OSVersionInfo.dwMinorVersion == 0)
{
//AfxMessageBox("Windows 2000 OS!");
cout << "Windows 2000 OS!" << endl;
}
else if(OSVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT
&& OSVersionInfo.dwMajorVersion == 5
&& OSVersionInfo.dwMinorVersion == 1)
{
//AfxMessageBox("Windows XP OS !");
cout << "Windows XP OS !" << endl;
}
else if(OSVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
&& OSVersionInfo.dwMajorVersion == 4
&& OSVersionInfo.dwMinorVersion == 0)
{
//AfxMessageBox("Windows 98 OS!");
cout << "Windows 98 OS!" << endl;
}