Missing Icons With EXE

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

Guest

I have an application (.exe) that is running in the system tray. When a
message arrives: the icon in the system tray is to change so that the user
knows a message has arrived.

My question is: how can I deploy .ico files with an application? I would
like to just send the people the .exe file and they can run that on their
computer. Is this possible? What code would I need to ensure this?

This works locally on my machine, but I have the paths hardcoded for
testing.

Thanks for any help
Andy
 
Andy said:
I have an application (.exe) that is running in the system tray. When a
message arrives: the icon in the system tray is to change so that the user
knows a message has arrived.

My question is: how can I deploy .ico files with an application? I would
like to just send the people the .exe file and they can run that on their
computer. Is this possible? What code would I need to ensure this?

This works locally on my machine, but I have the paths hardcoded for
testing.

Thanks for any help
Andy

You can compile the icons into to your app as a resource and then
accessing the icons with a System.Resources.ResourceManager
 
Tyron:

Thank you for the post. I added the icon files and compiled it as a
resource object, but I am having a little problem with the code accessing the
files.

System.Resources.ResourceManager rm = new
System.Resources.ResourceManager(typeof(System.Drawing.Icon));
notifyIcon.Icon = (System.Drawing.Icon)rm.GetObject("red.ico");

What am I doing wrong?

Thanks
Andy
 
Thank you for the response. I added the icon files as resources, however:
for some reason I am not able to access them in the code.

System.Resources.ResourceManager rm = new
System.Resources.ResourceManager(typeof(System.Drawing.Icon));
notifyIcon.Icon = (System.Drawing.Icon)rm.GetObject("red.ico");

Any idea what I might be doing wrong?

Thanks
 
Thank you for the response. I added the icon files as resources, however:
for some reason I am not able to access them in the code.

System.Resources.ResourceManager rm = new
System.Resources.ResourceManager(typeof(System.Drawing.Icon));
notifyIcon.Icon = (System.Drawing.Icon)rm.GetObject("red.ico");

Any idea what I might be doing wrong?

Thanks

System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(frmFormName));

this.toolStripButton1.Image =
((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));

Whidbey beta 2 ctp february 2005
 
Back
Top