I want to change icon on remote exe with one that is stored in RC_DATA in my original program (exe)
I'm using VC6
where is the error?
here's the code
HINSTANCE hExe = LoadLibrary(nameExe);
// first icon
HRSRC hRes = FindResource(NULL, MAKEINTRESOURCE(101), RT_GROUP_ICON);
HGLOBAL hResLoad = LoadResource(NULL, hRes);
PBYTE lpResLock = (PBYTE) LockResource(hResLoad);
int nID = LookupIconIdFromDirectory(lpResLock, TRUE );
HRSRC hRes2 = FindResource(NULL, MAKEINTRESOURCE(nID), MAKEINTRESOURCE(RT_ICON));
HGLOBAL hResLoad2 = LoadResource(NULL, hRes2);
PBYTE lpResLock2 = (PBYTE) LockResource(hResLoad2);
//second icon
HRSRC hRes3 = FindResource(NULL, MAKEINTRESOURCE(102), RT_GROUP_ICON);
HGLOBAL hResLoad3 = LoadResource(NULL, hRes3);
PBYTE lpResLock3 = (PBYTE) LockResource(hResLoad3);
int nID1 = LookupIconIdFromDirectory(lpResLock3, TRUE );
HRSRC hRes4 = FindResource(NULL, MAKEINTRESOURCE(nID1), MAKEINTRESOURCE(RT_ICON));
HGLOBAL hResLoad4 = LoadResource(NULL, hRes4);
PBYTE lpResLock4 = (PBYTE) LockResource(hResLoad4);
HANDLE hUpdateRes = BeginUpdateResource(nameExe, FALSE );
UpdateResource(hUpdateRes, RT_GROUP_ICON, MAKEINTRESOURCE(101),MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) , lpResLock4, SizeofResource(hExe, hRes4));
EndUpdateResource(hUpdateRes, FALSE);
where is the error?