运行时是否正确检查Windows是否为64位? (C )
发布时间:2020-12-14 04:14:01 所属栏目:Windows 来源:网络整理
导读:bool Win64bit = (sizeof(int*) == 8) ? 1 : 0; 我需要这个,所以我的应用程序可以正常使用Windows注册表功能(或者我需要?). 我做得对吗? 以下是Raymond Chen在 http://blogs.msdn.com/oldnewthing/archive/2005/02/01/364563.aspx博客中建议的内容: BOOL
bool Win64bit = (sizeof(int*) == 8) ? 1 : 0; 我需要这个,所以我的应用程序可以正常使用Windows注册表功能(或者我需要?). 我做得对吗?
以下是Raymond Chen在
http://blogs.msdn.com/oldnewthing/archive/2005/02/01/364563.aspx博客中建议的内容:
BOOL Is64BitWindows() { #if defined(_WIN64) return TRUE; // 64-bit programs run only on Win64 #elif defined(_WIN32) // 32-bit programs run on both 32-bit and 64-bit Windows // so must sniff BOOL f64 = FALSE; return IsWow64Process(GetCurrentProcess(),&f64) && f64; #else return FALSE; // Win64 does not support Win16 #endif } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- windows-phone-7 – WP7:在应用程序背景下编辑屏
- windows – powershell传递命令行参数
- windows 下的 Apache 二级域名 目录绑定配置
- windows-server-2008 – 访问被拒绝的问题,Windo
- windows-server-2012 – 启动IIS管理器具有Web平
- .net – 两个DLL中都存在该类型
- windows-server-2008 – 远程管理网络策略服务器
- windows-mobile – 通过ActiveSync连接时,从wind
- 批处理文件 – (Windows批处理)如果块中的Goto行
- windows – 你应该在捕获图像之前进行碎片整理吗
热点阅读