The way Windows chooses the icon of the
main executable file is that it looks for the first icon in the
resource section of the executable, or something along these lines.
First of all, you need to add a resource script, .rc file. This is done
through Project->Add New Item or right click on solution explorer
and go to Add->New Item. Chose Resource->Resrouce File(.rc) name
it then add it.
Now you have the resource file then you add the icon to it. Go to
resource view and right click on the name of your resource file. Right
at the bottom you will find Add Resource, select that then a new window
will pop up.
If you already have your icon saved seperatly then you should choose
Import and then import the icon. Otherwise select Icon and then
press New. The icon will be created and/or added to the resource script
and you will find that when you build your project it will be the icon
for the executable file.
If you want more than one icon in a project, make sure to add the
one you want as the executable icon first, otherwise you will have to
change the resource identifiers and put that icon as the lowest id.