|
-
July 16th, 2005, 12:03 AM
#1
help: Load icon from DLL
Please tell me how to load an icon from an icon library in a dll file.
Thanks.
-
July 16th, 2005, 01:43 AM
#2
Re: help: Load icon from DLL
See ExtractIcon() and ExtractIconEx() win32 API. These are easily interopted to give you this functionality.
You can use it like:
Code:
//interopt declaration
[DllImport("shell32.dll")]
static extern IntPtr ExtractIcon(IntPtr hInst, string Filename, int IconIndex);
//in your code somewhere...where "this" is in reference to your main form.
Icon myIcon = Icon.FromHandle(ExtractIcon(this.Handle, "somelib.dll", 0));
Hope this helps.
Regards.
-
July 17th, 2005, 01:08 AM
#3
Re: help: Load icon from DLL
Greetings.
I have created a sample project that implements a class that does the above described.
Feel free to offer feedback on this.
Regards.
P.S. The readme is from the artist that created the icon that is used in the project, not me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|