Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return values of OS() function
Message
From
03/08/2000 17:51:56
 
 
To
03/08/2000 17:34:18
Stan Vaninger
Mitek Industries, Inc
Missouri, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00400737
Message ID:
00400752
Views:
16
>Alex,
>
>Thanks very much for your quick reply.
>
>Do you know if the return for Windows 98 is any different than for Windows 98SE?
>

Not to OS(). It's the same underlying APIs and kernel; if you desperately need to distinguish things, you can implement the GetVersionEx() Win32API call, which returns an OSVERSIONINFO structure for Win9x and NT systems; I think the dwBuildNumber member of the structure can distinguish between the Win98 and Win98SE, but I'm not sure of this, and don't have a Win98 box here to test with.

Windows 2000 returns a different structure type, an OSVERSIONINFOEX structure that contains additional data, but is only applicable to Win2K.

The MSDN Library does not recommend relying on this mechanism
Remarks
When using the GetVersionEx function to determine whether your application is running on a particular version of the operating system, check for version numbers that are greater than or equal to the desired version numbers. This ensures that the test succeeds for later versions of the operating system. For example, if your application requires Windows 98, use the following test:
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO)
GetVersionEx (&osvi);
bIsWindows98orLater = 
   (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) &&
   ( (osvi.dwMajorVersion > 4) ||
   ( (osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion > 0) ) );
Identifying the current operating system is usually not the best way to determine whether a particular operating system feature is present. This is because the operating system may have had new features added in a redistributable DLL. Rather than using GetVersionEx to determine the operating system platform or version number, test for the presence of the feature itself. For more information, see Operating System Version.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform