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 debug权限提升

Delphi xe 遍历指定数据库,清空各表记录

dededl安卓中保持屏幕常亮

Delphi 正则表达式tperlregex 详解

Delphi:out参数和var参数的区别

Delphi 判断是否是0-9数字

Delphi_关于null,nil

Delphi文件操作的一些函数

Delphi 用sql语句添加删除修改字段

Delphi 2009 之 tedit 加强的功能

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



打赏

取消

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

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

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

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

评论

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