Delphi检查是否在64位Windows环境中运行?


本文整理自网络,侵删。

 
  {$J+}
function IsWow64Process: Boolean;
type
  TIsWow64Process = function(hProcess: THandle; var Wow64Process: Boolean): Boolean; stdcall;
var
  DLL: THandle;
  pIsWow64Process: TIsWow64Process;
const
  Called: Boolean = False;
  IsWow64: Boolean = False;
begin
  if (Not Called) then // only check once
  begin
    DLL := LoadLibrary('kernel32.dll');
    if (DLL <> 0) then
    begin
      pIsWow64Process := GetProcAddress(DLL, 'IsWow64Process');
      if (Assigned(pIsWow64Process)) then
      begin
        pIsWow64Process(GetCurrentProcess, IsWow64);
      end;
      Called := True; // avoid unnecessary loadlibrary
      FreeLibrary(DLL);
    end;
  end;
  Result := IsWow64;
end;
{$J-}

相关阅读 >>

Delphi ��b以 listbox 的item �� hint

Delphi有无生成空格的函数,like vb的space(1)

Delphi写的播放器核心代码,播放mp3无压力

Delphi 提升权限查找进程关闭进程单元

winapi 字符及字符串函数(12): lstrlen - 串长度

Delphi trim 删除字符串左右两边的空格

Delphi xe10 手机端错误提示:detected problems with api compatibility (visit g.co/dev/appcompat for more info

Delphi 下 vclzip控件的简单使用

Delphi xe5 中tmemo控件的应用――for android

Delphi中如何向某个ip不间断的发送数据

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...