Einzelnen Beitrag anzeigen

Bjoerk

Registriert seit: 28. Feb 2011
Ort: Mannheim
1.384 Beiträge
 
Delphi 10.4 Sydney
 
#6

AW: Registry Lesen und Schreiben Win 7 64 Bit

  Alt 2. Okt 2012, 10:14
Probier' mal so in Verbindung mit #3.

Delphi-Quellcode:
function IsWin7: boolean;
var
  osVerInfo: TOSVersionInfo;
  majorVersion, minorVersion: integer;
begin
  Result:= false;
  osVerInfo.dwOSVersionInfoSize:= SizeOf(TOSVersionInfo);
  if GetVersionEx(osVerInfo) then
  begin
    minorVersion:= osVerInfo.dwMinorVersion;
    majorVersion:= osVerInfo.dwMajorVersion;
    if osVerInfo.dwPlatFormId = VER_PLATForm_WIN32_NT then
      if (majorVersion = 6) and (minorVersion = 1) then
        Result:= true;
  end;
end;

function IsWow64: boolean;
type
  TIsWow64Process =
    function(Handle: Windows.THandle; var Res: Windows.BOOL): Windows.BOOL; stdcall;
var
  IsWow64Result: Windows.BOOL;
  IsWow64Process: TIsWow64Process;
begin
  Result:= False;
  if IsWin7 then
  begin
    IsWow64Process :=
      Windows.GetProcAddress(Windows.GetModuleHandle('kernel32'), 'IsWow64Process');
    if Assigned(IsWow64Process) then
      try
        IsWow64Process(Windows.GetCurrentProcess, IsWow64Result);
        Result:= IsWow64Result;
      except
        Result:= False;
      end;
  end;
end;

function GetRegPath: string;
var
  Substr: string;
begin
  if IsWow64 then
    Substr:= 'Wow6432Node\'
  else
    Substr:= '';
  Result:= 'SOFTWARE\' + Substr + 'Moeller Computer\MED Base\'
end;
  Mit Zitat antworten Zitat