I have done a bit of searching and I have seen this sequence of code several times :
HRSRC resrc = FindResource( hInstance, MAKEINTRESOURCE( resource ), TEXT("PNG") );
HGLOBAL hPng = LoadResource( hInstance, resrc );
PVOID pByte = LockResource( hPng );
So maybe you should call
FindResource
to see if it is really there. You can also use
Resource Hacker[
^] to verify this.
However, I have also read several places that one can not use a PNG file directly in a resource script so I
think the answer is it can be embedded as a binary byte stream and then it has to be decoded. The code above will obtain a pointer to that byte stream so it then needs to be decoded. What that means is
LoadImage
can not be used with a PNG file. It has to be a BMP, CUR, or ICO.
I am not certain of this but that is what my searching has indicated so far.