How can my C# application check whether a particular application/process (note: not the current process) is running in 32-bit or 64-bit mode?
For example, I might want to query a particular process by name, i.e, 'abc.exe', or based on the process ID number.
Here is the one line check.
You can check the size of a pointer to determine if it's 32bits or 64bits.
One of the more interesting ways I've seen is this:
To find out if OTHER processes are running in the 64-bit emulator (WOW64), use this code:
The selected answer is incorrect as it doesn't do what was asked. It checks if a process is a x86 process running on x64 OS instead; so it will return "false" for a x64 process on x64 OS or x86 process running on x86 OS.
Also, it doesn't handle errors correctly.
Here is a more correct method:
If you're using .Net 4.0, it's a one-liner for the current process:
See Environment.Is64BitProcessProperty (MSDN).