I need to know if a given .exe is 32-bit or 64-bit before starting it. IsWow64Process is useless here, since there is no process yet. Is there any other API that will give me this information?
IsWow64Process
If you really want to do this only for the EXE and not for the DLL, just use GetBinaryType .
Determines whether the file is an executable file (.exe), and if so, which subsystem launches the executable file.
This post will help you.
Is C # related, but it will give you this idea.
This information is available in one of the PE File file format headers (the format used for exe and dll). The information in these headers can either be retrieved programmatically (they have a given offset) or more securely requested through the Win32 API.
Ok, Liviu got the right signpost for you.