How to extract the program description from an EXE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave

    How to extract the program description from an EXE

    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.
    --
    Dave
  • Dmytro Lapshyn [MVP]

    #2
    Re: How to extract the program description from an EXE

    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:



    to get a lot of P/Invoke samples.

    --
    Sincerely,
    Dmytro Lapshyn [Visual Developer - Visual C# MVP]


    "Dave" <Dave@discussio ns.microsoft.co m> wrote in message
    news:FAA58266-23D6-431C-8858-2E9E75B00D7D@mi crosoft.com...[color=blue]
    > 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.
    > --
    > Dave[/color]

    Comment

    • Mattias Sjögren

      #3
      RE: How to extract the program description from an EXE

      > Can anyone tell me how to extract the resources, specifically the
      description[color=blue]
      > 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.[/color]

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


      Mattias

      Comment

      Working...