I have never heard the term "embed icons." If you are talking about the icon visible for the EXE or DLL in the explorer or shortcut on the desktop: this is done the same way for any Windows program. Both WF and WPF provide the assembly with an unmanaged resource with the selected icon using the / win 32res compilation option. You can see it in Visual Studio with the file + Open + File, select EXE or DLL.
To create a .res file, first create a .rc file. You can create it using the C ++ IDE. Right-click the solution, Add New Project, Visual C ++, Win32, Win32 Console Application. Right-click the folder "Resource Files", "Add + Resource", select "Icon", "Import". select your file. Repeat as necessary. After the build, you will receive a .res file in the project debugging creation directory.
Go back to your C # project, Project + Properties, Application tab. Select the Resource File option and browse to the .res file.
Hans Passant Jun 07 '10 at 21:31 2010-06-07 21:31
source share