如何知道可执行文件是32-bit还是64-bit

可以使用GetBinaryType API来获得这个信息:
BOOL GetBinaryType(
  LPCTSTR lpApplicationName,
  LPDWORD lpBinaryType
);
Binary Type可以是下面的值。
Value Meaning
SCS_32BIT_BINARY A 32-bit Windows-based application
SCS_64BIT_BINARY A 64-bit Windows-based application.
SCS_DOS_BINARY An MS-DOS – based application
SCS_OS216_BINARY A 16-bit OS/2-based application
SCS_PIF_BINARY A PIF file that executes an MS-DOS – based application
SCS_POSIX_BINARY A POSIX – based application
SCS_WOW_BINARY A 16-bit Windows-based application
也可以通过SHGetFileInfo API来获得这个信息,这个API还可以获得更多的文件信息,如各种图标等等,具体可以参看MSDN。


Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1571275


你可能感兴趣的:(bit)