Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

Load Icon from dll in .NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leon - 15 Sep 2004 05:26 GMT
Hi.

   How to load an icon from a dll in .NET? I know using API ExtractIcon()
can
do this. Does .NET framework provide some classes for this purpose?

Best Regards
Leon
Andrey - 16 Sep 2004 05:39 GMT
> Hi.
>
[quoted text clipped - 4 lines]
> Best Regards
> Leon

Yes.
First you need to add the icon file to the project and in
"Properties" Toolbar->"Build Action" property you need to set it as "Embedded Resource"
After that, in your code, you do the following:

Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream("youricon"));

where "youricon" is in following format: "projectname.youricon.ico".

I am using it frequently and it works fine for me.
Please let me know if you still need some help on that!

Good Luck,
Andrey
Leon - 15 Sep 2004 06:34 GMT
First, thanks for you reply!

   What you said is load icon from a .ico file.

   What I want to do it load icon resource from a dll file, for example,
C:\Winnt\System32\Shell32.dll.
the dll is a standard Win32 DLL, How I can load the icon in the dll?

Best Regards
Leon

> > Hi.
> >
[quoted text clipped - 19 lines]
> Good Luck,
> Andrey
Sijin Joseph - 16 Sep 2004 12:29 GMT
Check out these references

http://p2p.wrox.com/topic.asp?TOPIC_ID=78
http://www.dotnet247.com/247reference/a.aspx?u=http://www.pinvoke.net/default.as
px/shell32.ExtractIconEx

http://www.dotnet247.com/247reference/msgs/55/279166.aspx
http://custom.programming-in.net/articles/art9-1.asp?f=ExtractIcon

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> First, thanks for you reply!
>
[quoted text clipped - 38 lines]
>>Good Luck,
>>Andrey

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.