

Write changes to app_updated.exe and then close it. SizeofResource(hExe, hRes)) // size of resource info MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), // english MAKEINTRESOURCE(IDR_MAINFRAME), // resource id Result = UpdateResource(hUpdateRes, // update resource handle HUpdateRes = BeginUpdateResource(TEXT("app_updated.exe"), FALSE) Open the file to which you want to add the icon resource. Lock the resourcex into global memory. HRes = FindResource(hExe, MAKEINTRESOURCE(IDI_TB_SAVE), RT_GROUP_ICON) LPVOID lpResLock // pointer to resource data HANDLE hUpdateRes // update resource handle What am I missing here? HGLOBAL hResLoad // handle to loaded resource I don't see any references to the original icon in the updated exe.

ico file.Īfter running the update code, when I open the exe in Visual Studio, I see that the icon for IDR_MAINFRAME has been updated to the correct icon, but the image used for the exe in Explorer is still showing the old (original) icon. Custom Cursor is a browser extension that lets you change your cursor to a custom one from our giant cursor collection to choose from or upload your own.

Warning: It is not recommended to edit exe or dll files. rc file is IDR_MAINFRAME (ID 128) and is just a standard. If you try to edit a compressed exe file the behavior is unpredictable. I have followed several sites (including ) on how to do this programmatically. I don't know which icon to use until the app is installed on the users' machine. I have an app created in MFC that needs to have one of several icons set for the exe.
