title: Windows Version Using GetProductInfo
body: <p>I am trying to Display Windows Version and Product Details for Vista onwards OS using <a href="http://msdn.microsoft.com/library/windows/desktop/ms724358" rel="nofollow"><code>GetProductInfo</code></a> Function in Delphi XE2 as suggested by one Senoir Member. I have defined the following codes but I am not able to compile it. My codes as follows :</p>
  
  <pre><code>unit Unit1;
  
  interface
  
  uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
  
  type
    TForm1 = class(TForm)
      Edit1: TEdit;
      Edit2: TEdit;
      Edit3: TEdit;
      Edit4: TEdit;
      Edit5: TEdit;
      Button1: TButton;
      procedure Button1Click(Sender: TObject);
    private
      { Private declarations }
    public
      { Public declarations }
    end;
  
  var
    Form1: TForm1;
  
  implementation
  
  {$R *.dfm}
  
  procedure TForm1.Button1Click(Sender: TObject);
  type
  TGetProductInfoAPI = function(dwOSMajorVersion, dwOSMinorVersion,
  dwSpMajorVersion, dwSpMinorVersion: DWORD; pdwReturnedProductType:
  PDWORD): BOOL stdcall;
  begin
    Edit1.Text:=IntToStr(dwOSMajorVersion);
    Edit2.Text:=IntToStr(dwOSMinorVersion);
    Edit3.Text:=IntToStr(dwSpMajorVersion);
    Edit4.Text:=IntToStr(dwSpMinorVersion);
    Edit5.Text:=TGetProductInfoAPI.pdwReturnedProductType;
  end;
  
  end.
  </code></pre>
  
  <p>I think I am doing some mistakes but I am unable to find It. Please tell me where I am making mistake.</p>