How to extract the program description from an EXE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone tell me how to extract the resources, specifically the description
and icons, from a .EXE file programatically. Basically I want to write a C#
application that takes .EXE files and displays their description and their
icons, more or less like right-clicking the file in explorer and displaying
properties.
 
Hi Dave,

As far as I remember, all this info is in the EXE file's resources. So, you
should P/Invoke to the resource management APIs such as LoadIcon,
FindResource, LoadResource.

For example, to get the default app icon, you must load the EXE module with
LoadLibrary, then call LoadIcon with the obtained module handle, passing the
IDI_APPLICATION constant as the icon identifier.

You might want to take a look at this website:

http://www.pinvoke.net

to get a lot of P/Invoke samples.
 
Can anyone tell me how to extract the resources, specifically the
description
and icons, from a .EXE file programatically. Basically I want to write a C#
application that takes .EXE files and displays their description and their
icons, more or less like right-clicking the file in explorer and displaying
properties.

For the icon you can use the ExtractIcon[Ex] or SHGetFileInfo Win32 APIs.
For everything else you have the managed FileVersionInfo class.


Mattias
 
Back
Top