@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The SetMenuItemBitmaps API !!!!C# Signature: [DllImport("user32.dll")] static extern bool SetMenuItemBitmaps(IntPtr hMenu, uint uPosition, uint uFlags, IntPtr hBitmapUnchecked, IntPtr hBitmapChecked); !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: //Original thanx to: http://www.thecodeproject.com/cs/menu/menucontrolimage.asp [DllImport("user32.dll")] public static extern int SetMenuItemBitmaps(IntPtr hMenu, IntPtr nPosition, int wFlags, IntPtr hBitmapUnchecked, IntPtr hBitmapChecked); public const int MF_BYPOSITION = 0x400; private int AddImageToMenuItem(MenuItem mi,string bitmap_file) { Bitmap bmp = new Bitmap(bitmap_file); Color backColor = bmp.GetPixel(1, 1); bmp.MakeTransparent(backColor); return AddImageToMenuItem(mi,bmp); } private int AddImageToMenuItem(MenuItem mi,Bitmap bmp) { IntPtr intp = bmp.GetHbitmap(); return SetMenuItemBitmaps(mi.Parent.Handle,(IntPtr) mi.Index,MF_BYPOSITION,intp,intp); } !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: SetMenuItemBitmaps@msdn on MSDN
Edit user32.SetMenuIte...
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.