I searched around a bit, and all I could find was stuff about changing the icon of the EXE or using icons built into the EXE with a resource file. However, this is not what I want to do. I want to, given a file path, at runtime change the icon of the application. I have a variable that i think controls the icon of the window, and it seems to be of type HICON. I know this is possible because I see programs like windows explorer do it all the time. So what code and includes do I need to do this?
Er, he wants to modify the resources in another executable.
That isn't as simple as it looks at first blush. You might as well employ another application/library to do it. I use Resource Hacker. http://www.angusj.com/resourcehacker/
Hope this helps.
There are two icons in the window, 32x32 and 16x16. If you want to change the the icon at the task bar and title bar you should do hIconSm = (HICON)LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
Also, I found out the difference with the ICON_SMALL and ICON_BIG, if you only set ICON_SMALL then the Alt-Tab icon is stretched and looks bad. If you set the ICON_BIG as well as ICON_SMALL, then everything looks nice.