The link that Darin posted (which, therefore, was marked as an answer) does not contain functional code. I appreciated the code posted there (http://khason.net/blog/how-to-load-unmanaged-native-resources-from-managed-c-code/) and found that it does not work properly for any A bitmap embedded in any win32 dll as a bitmap resource.
In addition, Hans Passant leaves many steps, actually making it useless.
The only somewhat close solution I could find was an article written in 2004 for the XP Theme dll junk file. You can find the GetResourcePNG method in ThemeManager.cs here http://www.codeproject.com/KB/miscctrl/XPTaskBar.aspx
However, it should be noted that I had a lot of difficulties with this method, like calling bitmap.RotateFlip (RotateFlipType.Rotate180FlipX); causes memory problems when trying to access png in authui.dll file on my system
Update:
I found the code given here (http://www.vbaccelerator.com/home/NET/Code/Controls/Explorer_Bar/ExplorerBar_Control_Source_Code.asp) to be the most functional, produce the smallest errors and produce the fastest results. The code is written in C #, although the domain name points to something else. The use of two classes; ImageUtility and ResourceLibrary, you can easily pull PNG from the standard resource library DLL:
public static Bitmap GetStandardResourceBitmap(String dllName, String resourceId) { Bitmap result = null; using (ResourceLibrary library = new ResourceLibrary() { Filename = dllName }) { IntPtr hDib = library.GetResource(resourceId, ResourceLibrary.ImageType.IMAGE_BITMAP, ResourceLibrary.ImageLoadOptions.LR_CREATEDIBSECTION); if (!hDib.Equals(IntPtr.Zero)) { result = ImageUtility.DibToBitmap(hDib); ImageUtility.DeleteObject(hDib); } } return result; }
I decided to have resourceId in my String method, just because it does not require overloading and using numbered resource identifiers is as simple as adding "#".
GetStandardResourceBitmap("shell32.dll", "#632");
Greetings
source share