Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Show a bitmap for a menu item

 
Subscribe to the RSS feed for this forum  Forum Index -> EZNamespaceExtensionsMFC
View previous topic :: View next topic  
Author Message
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);
}
Back to top
Display posts from previous:   
Forum Index -> EZNamespaceExtensionsMFC All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group