Re: windows version in .h files
[email protected] Mon, 6 Feb 2006 06:54:27 EST
| Newsgroups | gmane.comp.lang.delphi.jedi |
|---|---|
| Message-ID | <[email protected]> |
The function I use to find the operating sysytem is ...
TOperatingSystem = (osUnknown, osWin95, osWin98, osWinNT, osWin2K, osWinXP);
function WinOpSys : TOperatingSystem;
var
Win95, Win98, WinNT, Win2K, WinXP : boolean; // all these for code clarity
begin
Win95 := (Win32MajorVersion = 4) and (Win32MinorVersion = 0)
and (Win32Platform = VER_PLATFORM_WIN32_WINDOWS);
Win98 := (Win32MajorVersion = 4) and (Win32MinorVersion = 10)
and (Win32Platform = VER_PLATFORM_WIN32_WINDOWS);
WinNT := (Win32MajorVersion = 4) and (Win32MinorVersion = 0)
and (Win32Platform = VER_PLATFORM_WIN32_NT);
WinXP := (Win32MajorVersion = 5) and (Win32MinorVersion = 1)
and (Win32Platform = VER_PLATFORM_WIN32_NT);
Win2K := (Win32MajorVersion = 5) and (Win32MinorVersion = 0)
and (Win32Platform = VER_PLATFORM_WIN32_NT);
Result := osUnknown; // default
if Win95 then
Result := osWin95
else
if Win98 then
Result := osWin98
else
if WinNT then
Result := osWinNT
else
if WinXP then
Result := osWinXP
else
if Win2k then
Result := osWin2K;
{end; if WinXP else}
{end; if WinNT else}
{end; if Win98 else}
{end; if Win95 else}
end;
Win32MajorVersion, Win32MinorVersion, & Win32Platform are Delphi constants.
As you say $0401 does not seem to be anywhere, perhaps its an error for
$0410.
Alan Lloyd
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Delphi-JEDI/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/