Take the following steps:
- Call
FindResource
passing module handle, resource type and resource name. This yields aHRSRC
. Note that if you have a resource ID rather than a resource name, useMAKEINTRESOURCE
to convert. - Call
LoadResource
passing theHRSRC
from the previous step. This yields anHGLOBAL
. - Call
LockResource
passing theHGLOBAL
. This yields a pointer to the first byte of the resource. - Call
SizeofResource
passing theHRSRC
to find the size of the resource. - Copy the content of the resource into your buffer using the pointer retrieved from step 3, and the size retrieved from step 4.