Executable icon without rc file

Hi everyone, only as a matter of curiosity, I am trying to setup the icon of my Win32 application without using the rc file. I mean the executable icon, not the window icon. So far I tried this:

1
2
windowClass.hIcon = (HICON)LoadImage(NULL,"icon.ico",IMAGE_ICON,32,32,LR_LOADFROMFILE);
windowClass.hIconSm = (HICON)LoadImage(NULL,"icon.ico",IMAGE_ICON,16,16,LR_LOADFROMFILE);

This sets correctly the small and big window icons, but not the executable file (viewed in Windows Explorer). Anyone know how to do this?
Windows Explorer uses the first icon it finds to display it, so there is no way of doing this without a resource file.
If you don't mind taking the extra (manual) step of doing it yourself:
http://www.angusj.com/resourcehacker/
Thank you all for the answers. I think this was not a good idea. Back to the rc file!
Topic archived. No new replies allowed.