Sign in Join
Wiki copytemporary

WindowsVersion/de

Deutsch · English · Русский

Zurück zur Seite Code Beispiele.\

Dieser Artikel beschäftigt sich mit der Windowsprogrammierung.
Die Funktion ermittelt die Nummer der aktuellen Windowsversion.\

pascal
uses
  Windows, SysUtils, ...;

  ...

{
Beispiele für Windows-Versionsnummern:
5.0 => Windows 2000
5.1 => Windows XP
5.2 => Windows XP64 oder Windows 2003 Server
6.0 => Windows Vista oder Windows 2008 Server
6.1 => Windows 7 oder Windows 2008 Server R2
6.2 => Windows 8 oder Windows Server 2012
6.3 => Windows 8.1 oder Windows Server 2012 RS
}

function funGetWinVer: string;
// Liefert die Versionsnummer von Windows als String
begin
  Result := IntToStr(LOBYTE(LOWORD(GetVersion)));
  Result := Result + '.';
  Result := Result + IntToStr(HIBYTE(LOWORD(GetVersion)));
end;

Alternativ stellt die Unit SysUtils die Versionsinformationen in Variablen bereit:

pascal
program EchoWinVersion;
uses sysutils;
begin
  Writeln('Win32Platform    : ', Win32Platform    );
  Writeln('Win32MajorVersion: ', Win32MajorVersion);
  Writeln('Win32MinorVersion: ', Win32MinorVersion);
  Writeln('Win32BuildNumber : ', Win32BuildNumber );
  Writeln('Win32CSDVersion  : ', Win32CSDVersion  );
  readln;
end.

Die Ausgabe sieht für Windows 7 Service Pack 1 so aus:

pascal
Win32Platform    : 2
Win32MajorVersion: 6
Win32MinorVersion: 1
Win32BuildNumber : 7601
Win32CSDVersion  : Service Pack 1

From the Free Pascal wiki, page "WindowsVersion/de", as it stood on 2020-12-10 after a change by FTurtle, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Edited on wiki.freepascal.org by 4 people, 2013–2020

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
OlafCreated page
Olaf (minor)
SockeWindows Versionen 6.2 und 6.3 hinzugefügt (minor)
Olaf (minor)
Olaf (minor)
Socke+ Category:Windows
FTurtle
FTurtle
TrevFixed syntax highlighting (minor)
TrevDelete English category (minor)
FTurtleDeleted categories which are already in template

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.