几个判断OS版本的函数
2010-03-10 19:46
330 查看
IsWin9x
Returns true if the operating system is on the Windows 9x platform or false if not.
Kind of Snippet: Routine
Required units: SysUtils, Windows.
Required snippets: None.
See also: IsWinNT, IsWow64, IsVista, IsWindows7, IsTabletOS, IsMediaCenterOS, [Show All].
Supported Compilers:
Windows 95, 98 and Me are all on the Windows 9x platform.
IsWinNT
Returns true if the operating system is on the Windows NT platform or false if not.
Kind of Snippet: Routine
Required units: SysUtils, Windows.
Required snippets: None.
See also: IsVista, IsWindows7, IsWin9x, IsWow64, IsTabletOS, IsMediaCenterOS, [Show All].
Supported Compilers:
Windows NT, 2000, XP, Server 2003, Vista, Server 2008 and Windows 7 are all on the NT Platform.
IsWow64
Returns true if the current process is executing as a 32 bit process under WOW64 on 64 bit Windows.
Kind of Snippet: Routine
Required units: SysUtils, Windows.
Required snippets: None.
See also: IsWin9x, IsWinNT, IsVista, IsWindows7, IsTabletOS, IsMediaCenterOS, [Show All].
Supported Compilers:
IsTabletOS
Returns true if the operating system is a Windows Tablet edition or false if not.
Kind of Snippet: Routine
Required units: Windows.
Required snippets: None.
See also: IsMediaCenterOS, IsWinNT, IsWin9x, IsWow64, IsVista, IsWindows7, [Show All].
Supported Compilers:
IsMediaCenterOS
Returns true if the operating system includes Windows Media Center or false if not.
Kind of Snippet: Routine
Required units: Windows.
Required snippets: None.
See also: IsTabletOS, IsWinNT, IsWin9x, IsWow64, IsVista, IsWindows7, [Show All].
Supported Compilers:
IsWindows7
Returns true if the operating system is Windows 7 (or Windows Server 2008 R2) or later and false if not.
Kind of Snippet: Routine
Required units: Windows.
Required snippets: None.
See also: IsWin9x, IsWinNT, IsWow64, IsTabletOS, IsMediaCenterOS, IsVista, [Show All].
Supported Compilers:
Returns true even if the application has defined a Windows Vista (or other) compatibility mode.
Returns true if the operating system is on the Windows 9x platform or false if not.
function IsWin9x: Boolean; begin Result := SysUtils.Win32Platform = Windows.VER_PLATFORM_WIN32_WINDOWS; end;
Kind of Snippet: Routine
Required units: SysUtils, Windows.
Required snippets: None.
See also: IsWinNT, IsWow64, IsVista, IsWindows7, IsTabletOS, IsMediaCenterOS, [Show All].
Supported Compilers:
D2 | D3 | D4 | D5 | D6 | D7 | D2005 (Win32) | D2006 (Win32) | D2007 | D2009 (Win32) | D2010 (Win32) | Free Pascal |
---|---|---|---|---|---|---|---|---|---|---|---|
IsWinNT
Returns true if the operating system is on the Windows NT platform or false if not.
function IsWinNT: Boolean; begin Result := (SysUtils.Win32Platform = Windows.VER_PLATFORM_WIN32_NT); end;
Kind of Snippet: Routine
Required units: SysUtils, Windows.
Required snippets: None.
See also: IsVista, IsWindows7, IsWin9x, IsWow64, IsTabletOS, IsMediaCenterOS, [Show All].
Supported Compilers:
D2 | D3 | D4 | D5 | D6 | D7 | D2005 (Win32) | D2006 (Win32) | D2007 | D2009 (Win32) | D2010 (Win32) | Free Pascal |
---|---|---|---|---|---|---|---|---|---|---|---|
IsWow64
Returns true if the current process is executing as a 32 bit process under WOW64 on 64 bit Windows.
function IsWow64: Boolean; type TIsWow64Process = function( // Type of IsWow64Process API fn Handle: Windows.THandle; var Res: Windows.BOOL ): Windows.BOOL; stdcall; var IsWow64Result: Windows.BOOL; // Result from IsWow64Process IsWow64Process: TIsWow64Process; // IsWow64Process fn reference begin // Try to load required function from kernel32 IsWow64Process := Windows.GetProcAddress( Windows.GetModuleHandle('kernel32.dll'), 'IsWow64Process' ); if Assigned(IsWow64Process) then begin // Function is implemented: call it if not IsWow64Process( Windows.GetCurrentProcess, IsWow64Result ) then raise SysUtils.Exception.Create('IsWow64: bad process handle'); // Return result of function Result := IsWow64Result; end else // Function not implemented: can't be running on Wow64 Result := False; end;
Kind of Snippet: Routine
Required units: SysUtils, Windows.
Required snippets: None.
See also: IsWin9x, IsWinNT, IsVista, IsWindows7, IsTabletOS, IsMediaCenterOS, [Show All].
Supported Compilers:
D2 | D3 | D4 | D5 | D6 | D7 | D2005 (Win32) | D2006 (Win32) | D2007 | D2009 (Win32) | D2010 (Win32) | Free Pascal |
---|---|---|---|---|---|---|---|---|---|---|---|
Returns true if the operating system is a Windows Tablet edition or false if not.
function IsTabletOS: Boolean; const SM_TABLETPC = 86; // metrics flag not defined in Windows unit begin Result := Windows.GetSystemMetrics(SM_TABLETPC) <> 0; end;
Kind of Snippet: Routine
Required units: Windows.
Required snippets: None.
See also: IsMediaCenterOS, IsWinNT, IsWin9x, IsWow64, IsVista, IsWindows7, [Show All].
Supported Compilers:
D2 | D3 | D4 | D5 | D6 | D7 | D2005 (Win32) | D2006 (Win32) | D2007 | D2009 (Win32) | D2010 (Win32) | Free Pascal |
---|---|---|---|---|---|---|---|---|---|---|---|
Returns true if the operating system includes Windows Media Center or false if not.
function IsMediaCenterOS: Boolean; const SM_MEDIACENTER = 87; // metrics flag not defined in Windows unit begin Result := Windows.GetSystemMetrics(SM_MEDIACENTER) <> 0; end;
Kind of Snippet: Routine
Required units: Windows.
Required snippets: None.
See also: IsTabletOS, IsWinNT, IsWin9x, IsWow64, IsVista, IsWindows7, [Show All].
Supported Compilers:
D2 | D3 | D4 | D5 | D6 | D7 | D2005 (Win32) | D2006 (Win32) | D2007 | D2009 (Win32) | D2010 (Win32) | Free Pascal |
---|---|---|---|---|---|---|---|---|---|---|---|
Returns true if the operating system is Windows 7 (or Windows Server 2008 R2) or later and false if not.
function IsWindows7: Boolean; var PFunction: Pointer; // points to PowerCreateRequest function if exists begin // Try to load PowerCreateRequest from Kernel32: // present if Windows 7 or Server 2008 R2 PFunction := Windows.GetProcAddress( Windows.GetModuleHandle('kernel32.dll'), 'PowerCreateRequest' ); Result := Assigned(PFunction); end;
Kind of Snippet: Routine
Required units: Windows.
Required snippets: None.
See also: IsWin9x, IsWinNT, IsWow64, IsTabletOS, IsMediaCenterOS, IsVista, [Show All].
Supported Compilers:
D2 | D3 | D4 | D5 | D6 | D7 | D2005 (Win32) | D2006 (Win32) | D2007 | D2009 (Win32) | D2010 (Win32) | Free Pascal |
---|---|---|---|---|---|---|---|---|---|---|---|
相关文章推荐
- 判断OS版本的几个方法
- Android利用系统提供的函数或常量判断版本大小
- PHP 版本判断 version_compare() 函数
- 安卓判断网络状态的几个常用函数
- vc 判断OS 所用语言版本
- PHP判断是否为空的几个函数对比
- 如何判断ie浏览器的几个版本
- 用C++写个程序,如何判断一个操作系统是16位还是32位的?不能用sizeof()函数?(不用sizeof()函数求当前主机上的一个int占用几个字节)
- PHP判断是否为空的几个函数对比
- PHP 版本判断 version_compare() 函数
- php中的几个判断文件和目录的函数 is_file() is_dir() mkdir() file_exists()
- 判断浏览器及os版本
- AS3,判断flash player版本的函数.
- vc 判断文件是否存在的几个函数
- 判断一个字符串同时出现几个字符的C#版本和JS版本
- 判断Email地址是否正确的几个函数(asp/php/javascript)
- PHP的几个常用数字判断函数代码
- PHP 版本判断 VERSION_COMPARE() 函数