ExtractIconEx using *.ico files?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am trying to use ExtractIconEx to show an icon on the notification area. The notification side of things is OK and working fine. However I need to be able to show a variety of icons; currently I am usin

ExtractIconEx(System.Reflection.Assembly.GetCallingAssembly().GetModules()[0].FullyQualifiedName, 0, 0, ref m_hIcon, 1)

which uses the current application icon; however I would like to point to a resource file or ico file to display.
 
The method I use is to add an to my project, under the properties for the
file I change build action to "Embeded Resource" then I can use the
following to get an Icon. DataTransfer is just a separate directory in my
project files view.

System.IO.Stream strm =
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(
"Pinnacle.WalkAbout.DataTransfer.BlankIcon.ico");

Icon ic = new Icon(strm);

Hope that helps.



Neil Macdonald said:
Hi,

I am trying to use ExtractIconEx to show an icon on the notification area.
The notification side of things is OK and working fine. However I need to
be able to show a variety of icons; currently I am usingExtractIconEx(System.Reflection.Assembly.GetCallingAssembly().GetModules()[0
].FullyQualifiedName, 0, 0, ref m_hIcon, 1);
which uses the current application icon; however I would like to point to
a resource file or ico file to display.
 
Back
Top