[Lazarus] WindowsVersion

Richard Mace richard.mace at gmail.com
Wed Jul 10 07:33:25 CEST 2013

Could someone let me know what until WindowsVersion is in please?
I am trying to write an app which detects which version of Windows the app
is being run on, and have found the following example, but it won't compile
because of the Str255 type and WindowsVersion:

Thanks in advance

function OSVersion: Str255;
  osErr: integer;
  response: longint;
  {$IFDEF LCLcarbon}
  OSVersion := 'Mac OS X 10.';
  {$IFDEF Linux}
  OSVersion := 'Linux Kernel ';
  OSVersion := 'Unix ';
  if WindowsVersion = wv95 then OSVersion := 'Windows 95 '
   else if WindowsVersion = wvNT4 then OSVersion := 'Windows NT v.4 '
   else if WindowsVersion = wv98 then OSVersion := 'Windows 98 '
   else if WindowsVersion = wvMe then OSVersion := 'Windows ME '
   else if WindowsVersion = wv2000 then OSVersion := 'Windows 2000 '
   else if WindowsVersion = wvXP then OSVersion := 'Windows XP '
   else if WindowsVersion = wvServer2003 then OSVersion := 'Windows Server
2003 '
   else if WindowsVersion = wvVista then OSVersion := 'Windows Vista '
   else if WindowsVersion = wv7 then OSVersion := 'Windows 7 '
   else OSVersion:= 'Windows ';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130710/f8b0e325/attachment-0002.html>

More information about the Lazarus mailing list