{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;Returns true if the operating system is Windows Vista or later and false if not. function IsVista: Boolean; var PFunction: Pointer; // pointer to GetProductInfo function if exists begin // Try to load GetProductInfo from Kernel32: present if Vista PFunction := Windows.GetProcAddress( Windows.GetModuleHandle('kernel32.dll'), 'GetProductInfo' ); Result := Assigned(PFunction); end;
{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;Returns true if the operating system is Windows Vista or later and false if not.
function IsVista: Boolean;
var
PFunction: Pointer; // pointer to GetProductInfo function if exists
begin
// Try to load GetProductInfo from Kernel32: present if Vista
PFunction := Windows.GetProcAddress(
Windows.GetModuleHandle('kernel32.dll'), 'GetProductInfo'
);
Result := Assigned(PFunction);
end;