Questions tagged [cmenu]

CMenu is a MFC encapsulation of Windows HMENU.

CMenu provides member functions for creating, tracking, updating, and destroying a menu.

Official documentation

42 questions
1
vote
1 answer

How do I get system default checkbox BITMAP in VS2015?

I want to get the system's default checkbox for to display it in an owner-drawn MFC menu. I have read this question, but that did not answer my question. I want to implement this line: hbmpCheckboxes = LoadBitmap((HINSTANCE) NULL, (LPTSTR)…
Jaap Scheper
  • 67
  • 11
1
vote
1 answer

How can I show a checkbox in an owner-drawn MFC CMenu derived menu?

I have a menu-class which inherits from the MFC CMenu class: MyMenu : public CMenu. MyMenu is loaded from a resource file and than changed to be an owner-drawn menu (using the code example from CodeGuru, which works well for styling of the…
Jaap Scheper
  • 67
  • 11
1
vote
1 answer

C++ CMenu Drawing Incorrectly (Non-custom)

I currently am attempting to do something simple: CMenu menu; menu.LoadMenu(IDR_MENU_IMAGE); CPoint pt; GetCursorPos(&pt); menu.TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this); When I right-click, I get the below image. However, the menu is…
RootAtShell
  • 115
  • 1
  • 7
1
vote
1 answer

CMenu border color on MFC

I've a class that inherit from CMenu Owner draw menu using this class the Menu appears correctly but, for example, when you open the menu FILE you will see the border and the separator of the standard menu color How I can paint also this part of…
SNC
  • 59
  • 2
  • 15
1
vote
1 answer

Creating a popup CMenu without a checkbox

I am creating a CMenu in Visual Studio 2010, MFC. I have a working CMenu that appears when a user right-clicks on a dialog. I can't seem to find a way to create menu selection without a spot for a checkbox. In Visual Studio's designer, my menu…
Kyle Williamson
  • 2,251
  • 6
  • 43
  • 75
1
vote
1 answer

Add confirmation to Yii Menu items

I have a menu like this in my Yii application: widget('zii.widgets.CMenu',array( 'items'=>array( array('label'=>'Home', 'url'=>array('/site/index')), array('label'=>'Login', 'url'=>array('/site/login'),…
Mazdak
  • 771
  • 2
  • 11
  • 24
1
vote
1 answer

Convert HTML Megamenu to Yii CMenu zii Widget

I just started working with Yii, and I am having some trouble converting my HTML Megamenu to Yii. Basically my html is something like this:
1
vote
1 answer

Simple way to show a bitmap next to a menu item in a CMenu with correct transparency

First off, I'm not a C++ developer, I program mainly in C#. I am trying to use the ContextMenu (yes I'm aware of ContextMenuStrip) class in .NET which is a wrapper around CMenu in my application. How do I display an image next to a menu item that…
test
  • 2,589
  • 2
  • 24
  • 52
1
vote
2 answers

How to add submenu to a CMenu in MFC?

I have an MFC app that uses CMenu for the main menu bar. I haven't been able to create submenus successfully. I can have the first level of File, Edit, View, etc and their sub menus, but I can't create a submenu off of one of those menus. For…
CodeFusionMobile
  • 14,812
  • 25
  • 102
  • 140
0
votes
0 answers

How to Copy CMenu into CMFCPopupMenu with all CMenu elements & Bitmaps?

I tried copying the CMenu Contents into CMFCPopupMenu using CMFCPopupMenu::Create() Method. All the CMenu Items are shown in PopUpMenu but Bitmaps are not Visible. I could not understand why. When I insert CMenu in Toolbar the Bitmaps are…
latosvarun
  • 93
  • 6
0
votes
0 answers

How to remove border of pop up menu in MFC

I have custom class which is is inherited from CMenu class. I am trying to change the background color of the menu items. But the border of the menu items remain unchanged. Following are my overridden functions: void…
amballip
  • 73
  • 4
0
votes
1 answer

Is there an easier way to determine that none of the menu items are set to MF_CHECKED

My code in itself is working OK and I am wondering if there is a simpler way to determine if at least one of my menu items are checked. Context The menu is being used by a CMFCMenuButton and looks like this: Behaviour The menu is essentially a set…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
2 answers

How to get string value from mfc popupmenu when clicked without making use of resource id

I'm creating a dynamic popup menu without generating resource ids. How can I keep track of the clicked action without a resource id? Is there any way I can get menu's string value? CMenu m_subMenu; m_subMenu.CreatePopupMenu(); utf16string…
Pinky
  • 1,217
  • 4
  • 17
  • 27
0
votes
2 answers

MFC: How do you add a bitmap to CMenu items added on OnInitMenuPopup?

I need to add custom menu items as needed. I found OnInitMenuPopup (WM_INITMENUPOPUP) does what I need but I can't get an icon to show next to the text on the menu? I've tried a 16x16 png graphic using m_MyGraphic as a CPngImage, I've tried…
user3161924
  • 1,849
  • 18
  • 33
0
votes
2 answers

Delay population of a sub menu in Windows and C++

I have an C++ MFC CMenu based context menu object that has several menu items and one menu item is a popup menu (ie has a sub menu). Populating the sub menu is a time intensive process so I don't want to actually populate it until the user clicks on…
snowdude
  • 3,854
  • 1
  • 18
  • 27