Today, Delphi is one of the popular desktop programming tool. There are thousand even million programmer in this world using delphi as their favorit tool. This site try to collect the examples, tips and tricks of Delphi programming. We collect, test them and redistribute the collection of delphi programming for you.

Check Windows NT or Not

Author: admin | Category: System, Windows API

//If we want to know the version of our windows is NT or not
//We can use GetVersionEx function to get the windows Version Information
 
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
function IsNT: boolean;
var OsVersion: TOSVersionInfo;
begin
  OsVersion.dwOSVersionInfoSize := sizeof(OsVersion);
  if( GetVersionEx(OsVersion) = true ) then
    Result := (OsVersion.dwPlatformId = VER_PLATFORM_WIN32_NT);
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  if IsNT = true then
    showmessage('This is Windows NT')
  else
    showmessage('This is NOT Windows NT');
 
end;
 
end.
 

Tags: ,