Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Embedded icons in .exe
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01502999
Message ID:
01503307
Views:
27
>>>>>>>Hi All, I've added several icons as embedded resources into my exe using the resource editor, however if I right click a shortcut to my.exe and select change icon / browse to my.exe - only the icon I set in the icon and manifest tab of the projects' properties tab is shown ? any ideas ?
>>>>>>
>>>>>>http://www.codeproject.com/KB/dotnet/embedmultipleiconsdotnet.aspx
>>>>>
>>>>>Thanks Viv, I actually read that article ( obviously not properly ! ) and couldn't get it to work - I was looking in the wrong place for Properties ! thanks again it works perfectly
>>>>
>>>>Sorry. Just noticed that the link was based on VS2005 but sounds like you found the right place to add the resource file to the app...
>>>
>>>Hi Viv, having successfuly created Resource.res - do you know how to extract an icon / cursor from one ? I've googled away but can't find much of use
>>
>>In VS just open the .res file (using File/Open)
>>Locate the icon that you want to extract.
>>Right Click , choose Export.....
>
>Hi Viv, sorry I didn't word my question very well - what I meant to ask was - now that I've embedded some icons / cursors / images etc... - how can I access them at runtime - I basically want to give certain groups of users different icons / background images etc... at runtime

I don't think there's a simple way of retrieving from the Win32 resource file but if you add the icons to the embedded resources you could just use:
this.Icon = (Icon)WindowsFormsApplication1.Properties.Resources.ResourceManager.GetObject("RESOURCENAME");
(adjust namespace to suit)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform