How to display a selected executable's main icon on my form (C#.NET 2.0 VS2005)

Posted on 2006-05-10
Last Modified: 2011-09-20
Hi :)

My application allows users to select other executable files and performs some functions with them.  I would like to display the main icon like explorer.exe would in tile mode on my applications form (PictureBox?).  I am currently reading the executable they select into a byte array so I can get other information from it.  An example of how to locate the image from the other executable now in my array and display it on my form would be greatly appreciated :)

Bosses are on me for this one and I would really like to add that feature before I give this to them :)
Question by:jploettner
    LVL 19

    Accepted Solution

    You can use the new ExtractAssociatedIcon() Method in .Net 2.0 that retursn associated icon
    Icon ico = Icon.ExtractAssociatedIcon(@"C:\WINDOWS\system32\notepad.exe");

    Author Comment

    Man that works sweet, I thought it would have been a real pain...  Thanks much :)

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now