When an EXE file is created by a compiler, it has the standard rectangle icon. How do I change it to my own icon? Do I have to do this through code or I can right-click the file's icon on the desktop and change choose a new icon through the display properties window?
You will need to tell your compiler how to compile and link the resource file.
Using the GCC, you would first use WindRes:
windres resources.rc resources.o
Then compile and link with the resources
g++ -o myprog myprog.o resources.o
Other compilers will vary.
The other way to do it (and I good one, I think) is to get Resource Hacker http://www.angusj.com/resourcehacker/
and use it to replace the icons in the file. You can do it graphically or from the command line. The program comes with documentation.