DelphiFAQ Home Search:
General :: Windows :: Programming :: Windows with Delphi :: Windows API
Windows programming with Delphi

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

Retrieving the active version of Windows or DOS

Call the GetVersion Windows API function to return version information for Windows and DOS.
The function returns a LongInt which contains this information:

  • Byte #1 - Windows Version (Integer part)
  • Byte #2 - Windows Version (Fractional part)
  • Byte #3 - DOS Version (Fractional part)
  • Byte #4 - DOS Version (Integer part)
To display the versions in a Delphi form, create two Labels and add the following OnCreate event-handler:

procedure TForm1.FormCreate(Sender: TObject);
 var
   Version : LongInt;
 begin
   Version := GetVersion;
   Label1.Caption := 'Windows ' +
     IntToStr(LoByte(LoWord(Version))) + '.' +
     IntToStr(HiByte(LoWord(Version)));
   Label2.Caption := 'DOS ' +
     IntToStr(HiByte(HiWord(Version))) + '.' +
     IntToStr(LoByte(HiWord(Version)));
 end;
You don't like the formatting? Check out SourceCoder then!
Generated 8:01:45 on Nov 22, 2019