Subj : Re: Detecting Win XP To : borland.public.cpp.borlandcpp From : Jogy Date : Tue Jun 15 2004 04:42 pm A Davis wrote: > Hello All > > I can detect whether the OS is Win2000/NT using the code shown below, but is > there a way to detect if it's Win XP (as opposed to Win98) ? > It's probably possible to look at the Windows Folder to see if it contains a > WinXP sub-string, but this seems like a dangerous method. > > Thanks, > Regards Al > > ______ > OSVERSIONINFO osv; > osv.dwOSVersionInfoSize=sizeof(osv); > GetVersionEx(&osv); > if(osv.dwPlatformId==VER_PLATFORM_WIN32_NT)...it's Windows NT/2000 > ______ > > Hello, The VER_PLATFORM_WIN32_NT includes XP. You must check the dwMajorVersion and dwMinorVersion members: dwMajorVersion Identifies the major version number of the operating system as follows. Windows 95: 4 Windows 98: 4 Windows Me: 4 Windows NT 3.51: 3 Windows NT 4.0: 4 Windows 2000: 5 Windows XP: 5 Windows .NET Server: 5 dwMinorVersion Identifies the minor version number of the operating system as follows. Windows 95: 0 Windows 98: 10 Windows Me: 90 Windows NT 3.51: 51 Windows NT 4.0: 0 Windows 2000: 0 Windows XP: 1 Windows .NET Server: 1 Check this sample code from MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp -- Jogy http://www.jogy.net/ jogy@sirma.bg .