PDA

View Full Version : سوال: تشخصي ويندوز 32بيتي از 64بيتي؟



bmanfy
شنبه 24 مهر 1389, 13:55 عصر
سلام.
چه طور ميشه فهميد ويندوزي كه الان داره استفاده ميشه 32بيتي هست يا 64بيتي؟

hossein_h62
شنبه 24 مهر 1389, 14:30 عصر
سلام
اینجوری :



function Is64BitOS: Boolean;
type
TIsWow64Process = function(Handle:THandle; var IsWow64 : BOOL) : BOOL; stdcall;
var
hKernel32 : Integer;
IsWow64Process : TIsWow64Process;
IsWow64 : BOOL;
begin
Result := False;
hKernel32 := LoadLibrary('kernel32.dll');
if (hKernel32 = 0) then RaiseLastOSError;
@IsWow64Process := GetProcAddress(hkernel32, 'IsWow64Process');
if Assigned(IsWow64Process) then begin
IsWow64 := False;
if (IsWow64Process(GetCurrentProcess, IsWow64)) then begin
Result := IsWow64;
end
else RaiseLastOSError;
end;
FreeLibrary(hKernel32);
end;

Felony
شنبه 24 مهر 1389, 20:59 عصر
function Test64Bit: Boolean;
type
TIsWow64Process = function(Handle: THandle; var Res: BOOL): BOOL; stdcall;
var
IsWow64Result: BOOL;
IsWow64Process: TIsWow64Process;
begin
IsWow64Process := GetProcAddress(
GetModuleHandle('kernel32'), 'IsWow64Process'
);
if Assigned(IsWow64Process) then
begin
if not IsWow64Process(GetCurrentProcess, IsWow64Result) then
raise Exception.Create('Bad process handle');
Result := IsWow64Result;
end
else
Result := False;
end;