Non-bitmap, cursor, menu and other resources

xiaoxiao2021-03-06  99

In engineering, bitmaps, cursors, menu and other resources can be read with related functions. For general apart, resources can be read as follows:

Hinstance hinst = afxgetresourcehandle ();

HRSRC HRSRC = :: FindResource (hinst,

MakeintResource (IDR_MB), // Resource ID

"MB" // resource type

);

IF (! hrsrc)

Return False;

// load resource Into Memory

DWORD LEN = SizeOfResource (Hinst, HRSRC); // Resource Size

Byte * lprsrc = (byte *) loadResource (hinst, hrsrc); // read resources into memory and get the first address pointer

IF (! lprsrc)

Return False;

转载请注明原文地址:https://www.9cbs.com/read-96849.html

New Post(0)