I'm doing @Sharptooth explained before and use the following code to get the resource
HRSRC hResInfo = FindResource(hInstance, MAKEINTRESOURCE(resourceId), type);
HGLOBAL hRes = LoadResource(hInstance, hResInfo);
LPVOID memRes = LockResource(hRes);
DWORD sizeRes = SizeofResource(hInstance, hResInfo);
Here you have to change resourceId
and type
.
For example for a .png file I use FindResource(hInstance, MAKEINTRESOURCE(bitmapId), _T("PNG"));
(the "PNG" string is the type you used when adding a custom resource).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…