Detect 32-bit or 64-bit of Windows

Rahul picture Rahul · Aug 10, 2011 · Viewed 53.6k times · Source

I want to detect whether the current Windows OS is 32-bit or 64-bit. How to achieve it using C++? I don't want processor type I want OS's bit type. This is because you can install 32-bit OS on 64-bit processor.

Answer

Bo Persson picture Bo Persson · Aug 10, 2011

The function to call is IsWow64Process or IsWow64Process2. It tells your 32-bit application if it is running on a 64 bit Windows.

If the program is compiled for 64 bits, it will already know.