Load icon from dll resource [newbie]

  • Thread starter Thread starter Maciek
  • Start date Start date
M

Maciek

Hi,
I've got dll resource file [icons.dll] with icon and I don't how to
get it.
Is it exists something like:

Icon myIcon = ...icons.dll...?

I've read about Loadlibrary(), LoadResource() and ExtractIconEx() -
but there is a problem - I don't have this function.

Tnx for help
 
Hello Maciek,
If your icons.dll is a .NET assembly you might implement Assembly.GetManifestResourceStream


Best of luck!

Your C# ally ,
RBischoff


M> Hi,
M> I've got dll resource file [icons.dll] with icon and I don't how to
M> get it.
M> Is it exists something like:
M> Icon myIcon = ...icons.dll...?
M>
M> I've read about Loadlibrary(), LoadResource() and ExtractIconEx() -
M> but there is a problem - I don't have this function.
M>
M> Tnx for help
M>
 
I use ExtractIcon method:

[DllImport("shell32.dll",CharSet=CharSet.Auto)]
public static extern IntPtr ExtractIcon(int hInst,string file,int
index);

public Icon loadIcon(int index) {
return Icon.FromHandle(ExtractIcon(GetModuleHandle(String.Empty),
"Icons.dll", index);
)

Does exist analogue method, which has id param (string) instead of
index? So, I want call loadIcon("someUniqueName"); instead of
loadIcon(123);

Maciek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top