@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The CreateIconIndirect API !!!!C# Signature: [DllImport("user32.dll")] static extern IntPtr CreateIconIndirect([In] ref ICONINFO piconinfo); !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: [StructLayout(LayoutKind.Sequential)] private struct ICONINFO { public bool IsIcon; public int xHotspot; public int yHotspot; public IntPtr MaskBitmap; public IntPtr ColorBitmap; }; [DllImport("user32.dll")] private static extern IntPtr CreateIconIndirect([In] ref ICONINFO iconInfo); [DllImport("gdi32.dll")] public static extern bool DeleteObject(IntPtr hObject); private static void CreateIcon() { ICONINFO ii = new ICONINFO(); ii.IsIcon = true; Bitmap img = GetIconBitmap(...); IntPtr imgHandle = img.GetHbitmap(); try { ii.MaskBitmap = imgHandle; ii.ColorBitmap = imgHandle; IntPtr handle = CreateIconIndirect(ref ii); _formIcon = Icon.FromHandle(handle); } finally { DeleteObject(imgHandle); } } !!!!Alternative Managed API: Bitmap.FromHicon() Documentation: CreateIconIndirect@msdn on MSDN
Edit user32.CreateIcon
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.