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函数

键盘钩子,鼠标钩子,Delphi环境下编写的键盘鼠标钩子的程序示例

Delphi 10.3新特性 内联变量

Delphi双进程监控

Delphi adoconnection1连接mssql数据库方法

Delphi实例之一个较复杂的记事本的实现

Delphi 检验手机号 ismobilenumber

Delphi xe5 将Delphi code从winos 迁移到ios与android

Delphi Delphi中点击dbgrid某一行获得其详细数据方法

Delphi 取出鼠百标点击的 stringgrid 中某单度元格的值

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



打赏

取消

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

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

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

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

评论

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