[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-05-10
2
Medium Priority
?
435 Views
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 :)
0
Comment
Question by:jploettner
2 Comments
 
LVL 19

Accepted Solution

by:
Fahad Mukhtar earned 2000 total points
ID: 16656188
You can use the new ExtractAssociatedIcon() Method in .Net 2.0 that retursn associated icon
Icon ico = Icon.ExtractAssociatedIcon(@"C:\WINDOWS\system32\notepad.exe");
0
 

Author Comment

by:jploettner
ID: 16656650
Man that works sweet, I thought it would have been a real pain...  Thanks much :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

831 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