Feb 27, 2001 #1 Robertus Programmer Feb 16, 2001 81 RO How do I find wich operating system is on my machine? (programatically) Thanks for reading this!
Feb 27, 2001 #2 KeithBrautigam Programmer Nov 4, 2000 71 US Please try the following code: OSVERSIONINFO verInfo; verInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); GetVersionEx( &verInfo ); if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) { AfxMessageBox( "Windows 95/98/Me" ); } else { if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) { AfxMessageBox( "Windows NT or 2000" ); } } For more information see http://msdn.microsoft.com/library/psdk/sysmgmt/sysinfo_49iw.htm Upvote 0 Downvote
Please try the following code: OSVERSIONINFO verInfo; verInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); GetVersionEx( &verInfo ); if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) { AfxMessageBox( "Windows 95/98/Me" ); } else { if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) { AfxMessageBox( "Windows NT or 2000" ); } } For more information see http://msdn.microsoft.com/library/psdk/sysmgmt/sysinfo_49iw.htm