Fórum FUNÇÃO PARA DESCOBRIR SE É Windows 32 OU 64BITS #426921
23/10/2012
0
Gostaria de saber se alguém já usou esta função, e que pudesse me informar se é confiável ou não?
Segue o link para a mesma >>
http://scriptbrasil.com.br/forum/index.php?showtopic=158389
Em caso de a função referida acima não servir, queria saber se existe algum outro código que possibilite saber de quantos bits é o Windows, pois até então só achei função que me informa apenas o Sistema Operacional e sua Versão.
Brigadão!!
Luiz Eduardo
Curtir tópico
+ 0Post mais votado
23/10/2012
var
Form1: TForm1;
implementation
{$R *.dfm}
function IsWindows64: Boolean;
type
TIsWow64Process = function(AHandle:THandle; var AIsWow64: BOOL): BOOL; stdcall;
var
vKernel32Handle: DWORD;
vIsWow64Process: TIsWow64Process;
vIsWow64: BOOL;
begin
Result := False;
vKernel32Handle := LoadLibrary('kernel32.dll');
if (vKernel32Handle = 0) then Exit;
try
@vIsWow64Process := GetProcAddress(vKernel32Handle, 'IsWow64Process');
if not Assigned(vIsWow64Process) then Exit;
vIsWow64 := False;
if (vIsWow64Process(GetCurrentProcess, vIsWow64)) then
Result := vIsWow64;
finally
FreeLibrary(vKernel32Handle);
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
if IsWindows64 = true then
showmessage('O sistema windows é 64 Bits')
else
showmessage('O sistema windows é 32 Bits')
end;agora é só vc adaptar ao seu uso.
at+
Gilvanio Gonçalves
Gostei + 2
Mais Posts
24/10/2012
Alisson Santos
Gostei + 0
24/10/2012
Luiz Eduardo
Gostei + 0
25/10/2012
Gilvanio Gonçalves
abs.
Gostei + 0
25/10/2012
Alisson Santos
abs.
Giovane me desculpa se passou essa impressão eu estava explicando para ele o porque ocorreu de falar que era virus o que ele tinha.
Gostaria de saber de consegui fazer funcionar??
Gostei + 0
26/10/2012
Luiz Eduardo
Mas Gilvanio aqui eu to querendo botar num IdMessage.Body.Add(IsWindows64);
mas tá dando esse erro >>
[Error] Unit1.pas(411): Incompatible types: 'String' and 'Boolean'
HÁ SOLUÇÃO PARA ISSO?
Valeu!!
Gostei + 0
26/10/2012
Claudia Nogueira
Exemplo:
function IsWindows64: String;
type
TIsWow64Process = function(AHandle:THandle; var AIsWow64: BOOL): BOOL; stdcall;
var
vKernel32Handle: DWORD;
vIsWow64Process: TIsWow64Process;
vIsWow64: BOOL;
begin
vKernel32Handle := LoadLibrary('kernel32.dll');
if (vKernel32Handle = 0) then Exit;
try
@vIsWow64Process := GetProcAddress(vKernel32Handle, 'IsWow64Process');
if not Assigned(vIsWow64Process) then Exit;
vIsWow64Process(GetCurrentProcess, vIsWow64);
if vIsWow64 then
Result := 'O sistema windows é 64 Bits'
else
Result := 'O sistema windows é 32 Bits';
finally
FreeLibrary(vKernel32Handle);
end;
end;
Mas Gilvanio aqui eu to querendo botar num IdMessage.Body.Add(IsWindows64);
mas tá dando esse erro >>
[Error] Unit1.pas(411): Incompatible types: 'String' and 'Boolean'
HÁ SOLUÇÃO PARA ISSO?
Valeu!!
Gostei + 0
26/10/2012
Luiz Eduardo
Exemplo:
function IsWindows64: String;
type
TIsWow64Process = function(AHandle:THandle; var AIsWow64: BOOL): BOOL; stdcall;
var
vKernel32Handle: DWORD;
vIsWow64Process: TIsWow64Process;
vIsWow64: BOOL;
begin
vKernel32Handle := LoadLibrary('kernel32.dll');
if (vKernel32Handle = 0) then Exit;
try
@vIsWow64Process := GetProcAddress(vKernel32Handle, 'IsWow64Process');
if not Assigned(vIsWow64Process) then Exit;
vIsWow64Process(GetCurrentProcess, vIsWow64);
if vIsWow64 then
Result := 'O sistema windows é 64 Bits'
else
Result := 'O sistema windows é 32 Bits';
finally
FreeLibrary(vKernel32Handle);
end;
end;
Mas Gilvanio aqui eu to querendo botar num IdMessage.Body.Add(IsWindows64);
mas tá dando esse erro >>
[Error] Unit1.pas(411): Incompatible types: 'String' and 'Boolean'
HÁ SOLUÇÃO PARA ISSO?
Valeu!!
MUITÍSSIMO OBRIGADO CLAUDIA! DEU CERTO.
Gostei + 0
26/10/2012
Gilvanio Gonçalves
Exemplo:
function IsWindows64: String;
type
TIsWow64Process = function(AHandle:THandle; var AIsWow64: BOOL): BOOL; stdcall;
var
vKernel32Handle: DWORD;
vIsWow64Process: TIsWow64Process;
vIsWow64: BOOL;
begin
vKernel32Handle := LoadLibrary('kernel32.dll');
if (vKernel32Handle = 0) then Exit;
try
@vIsWow64Process := GetProcAddress(vKernel32Handle, 'IsWow64Process');
if not Assigned(vIsWow64Process) then Exit;
vIsWow64Process(GetCurrentProcess, vIsWow64);
if vIsWow64 then
Result := 'O sistema windows é 64 Bits'
else
Result := 'O sistema windows é 32 Bits';
finally
FreeLibrary(vKernel32Handle);
end;
end;
Mas Gilvanio aqui eu to querendo botar num IdMessage.Body.Add(IsWindows64);
mas tá dando esse erro >>
[Error] Unit1.pas(411): Incompatible types: 'String' and 'Boolean'
HÁ SOLUÇÃO PARA ISSO?
Valeu!!
MUITÍSSIMO OBRIGADO CLAUDIA! DEU CERTO.
Desculpe, Não te responder antes, estive fora, mas lhe foi respondido na integra pela Claudia, e a vc Allison tudo bém, mas cuidado ao responder algo que possa ser interpretado como duplo sentido.
Gostei + 0
31/01/2017
Josimar
else IdMessage.Body.Add('O sistema windows é 32 Bits');
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)