How to get information about the computer? [32bit or 64bit]

gedO picture gedO · Mar 26, 2010 · Viewed 8.1k times · Source

How I can get information about Windows OS type? Is it 32bit or 64bit? How I can get this information programatically?

Answer

kludg picture kludg · Mar 26, 2010
function IsWin64: Boolean;
var
  IsWow64Process : function(hProcess : THandle; var Wow64Process : BOOL): BOOL; stdcall;
  Wow64Process : BOOL;
begin
  Result := False;
  IsWow64Process := GetProcAddress(GetModuleHandle(Kernel32), 'IsWow64Process');
  if Assigned(IsWow64Process) then begin
    if IsWow64Process(GetCurrentProcess, Wow64Process) then begin
      Result := Wow64Process;
    end;
  end;
end;