Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Como saber version de windows (32 o 64 bits) ?? (https://www.clubdelphi.com/foros/showthread.php?t=62843)

jandok238 16-01-2009 18:00:46

Como saber version de windows (32 o 64 bits) ??
 
Buenos dias...

la pregunta es esa, la del titulo de este hilo ...

Como saber el tipo de Windows, si es de 32 o de 64 bits ???...

He dado una busqueda por el foro, pero lo que encontre solo me
da como respuetas el nombre del windows (98, ME, XP y su Service Pack, y Vista) ...
pero si tengo el VISTA 64, no se como hacer que me indique
que tipo de VISTA o XP es de 64 bits ....

Gracias

Salu2!!!!!!!

dec 16-01-2009 18:43:05

Hola,

En cierta unidad de la JVCL se implementa lo que necesitas, empero, he aislado el siguiente código, de modo que puede usarse la función "IsWindows64" sin más:

Código Delphi [-]
const
  PROCESSOR_ARCHITECTURE_AMD64 = 9;
  {$EXTERNALSYM PROCESSOR_ARCHITECTURE_AMD64}
  PROCESSOR_ARCHITECTURE_IA64 = 6;
  {$EXTERNALSYM PROCESSOR_ARCHITECTURE_IA64}

function GetNativeSystemInfo(var SystemInfo: TSystemInfo): Boolean;
type
  TGetNativeSystemInfo = procedure (var SystemInfo: TSystemInfo) stdcall;
var
  LibraryHandle: HMODULE;
  _GetNativeSystemInfo: TGetNativeSystemInfo;
begin
  Result := False;
  LibraryHandle := GetModuleHandle(kernel32);

  if LibraryHandle <> 0 then
  begin
    _GetNativeSystemInfo := GetProcAddress(
      LibraryHandle, 'GetNativeSystemInfo');
    if Assigned(_GetNativeSystemInfo) then
    begin
      _GetNativeSystemInfo(SystemInfo);
      Result := True;
    end
    else
      GetSystemInfo(SystemInfo);
  end
  else
    GetSystemInfo(SystemInfo);
end;

function IsWindows64: Boolean;
var
  ASystemInfo: TSystemInfo;
begin
  GetNativeSystemInfo(ASystemInfo);
  Result := ASystemInfo.wProcessorArchitecture in
    [PROCESSOR_ARCHITECTURE_IA64, PROCESSOR_ARCHITECTURE_AMD64];
end;

A ver si te apaña o qué. ;)

jandok238 19-01-2009 17:17:22

Gracias DEC ... y pues parece que si trabaja bien ... ;);):D:D

solo que se me estaba pasando agradecerte.... :D:D:D

Gracias....

salu2!!!!!!!


La franja horaria es GMT +2. Ahora son las 20:11:13.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi