如何确定我的应用程序是否在x86或x64 Windows上运行? [英] How do I find out if my application is running on x86 or x64 Windows?
问题描述
我想在运行时知道我是在32位还是64位窗口上运行. OSVERSIONINFOEX结构告诉我主要版本和次要版本,但是我猜我需要内部版本号.有人知道他们是什么吗?
I want to know, at run time, whether I'm running on 32 bit or 64 bit windows. The OSVERSIONINFOEX structure tells me the major and minor version, but I'm guessing I need the build numbers. Anyone know what they are?
推荐答案
如果您的应用程序是针对64位编译的,那么答案很简单:您正在64位Windows上运行.
If your application is compiled for 64-bit, then the answer's easy: you're running on 64-bit Windows.
如果您的应用程序是针对32位编译的,则需要调用 IsWow64Process .此功能仅在Windows XP或更高版本上导出;如果要支持Windows的早期版本,则需要使用GetProcAddress来获取指向此函数的指针.
If your application is compiled for 32-bit, you need to call IsWow64Process. This function is only exported on Windows XP or later; if you want to support earlier versions of Windows, you'll need to use GetProcAddress to get a pointer to this function.
这篇关于如何确定我的应用程序是否在x86或x64 Windows上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!