Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Tue Jan 27, 2009 9:01 am Post subject: HOWTO: Show a bitmap for a menu item |
|
|
Use the following code in the GetMenuItems function to show a bitmap for a menu item :
Code: | void CEZNamespaceExtensionsFolder::GetMenuItems(CGetMenuitemsEventArgs& e)
{
CShellMenuItem* menuitem = e.menu->AddItem(_T("Context menu Item"),_T("contextmenuitem"),_T(""));
//Set the path to your .bmp file here
CString imagePath = _T("c:\\mybitmap.bmp");
HBITMAP hBmp = (HBITMAP)LoadImage(NULL,imagePath,IMAGE_BITMAP,0,0, LR_LOADFROMFILE);
menuitem->SetBitmap(hBmp);
} |
|
|