Advertisement
Advertisement
| 07.24.2008 at 07:52PM PDT, ID: 23594425 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: |
hRes = FindResource(hExe, L"F:\\img.bmp", RT_BITMAP);
if (!hRes)
{
// return;
}
// Load the dialog box into global memory.
hResLoad = LoadResource(hExe, hRes);
if (hResLoad == NULL)
{
// return;
}
// Lock the dialog box into global memory.
lpResLock = LockResource(hResLoad);
if (lpResLock == NULL)
{
// return;
}
// Open the file to which you want to add the dialog box resource.
HANDLE h = CreateFile(L"F:\\img.bmp", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
DWORD dw = GetFileSize(h, NULL);
LPBYTE lpBuffer;
lpBuffer= new BYTE[dw];
hUpdateRes = BeginUpdateResource(L"F:\\Foot.exe", FALSE);
if (!hUpdateRes)
{
return;
}
if(!UpdateResource(hUpdateRes,RT_BITMAP, L"F:\\img.bmp",MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),lpBuffer,dw))
{
return;
}
if(!EndUpdateResource(hUpdateRes, FALSE))
{
return;
}
|