public static Bitmap FromHicon(IntPtr hicon) { IntPtr bitmap; Status status = GDIPlus.GdipCreateBitmapFromHICON(hicon, out bitmap); GDIPlus.CheckStatus(status); return(new Bitmap(bitmap)); }