Print Page | Close Window

Returning a HMenu of the command bar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=7143
Printed Date: 03 March 2025 at 4:13pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Returning a HMenu of the command bar
Posted By: guywmustang
Subject: Returning a HMenu of the command bar
Date Posted: 15 May 2007 at 5:22pm
I have my code creating the command bars using the following code:

   
CXTPCommandBars* pCommandBars = GetCommandBars();

CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);


I need to get a HMenu of the menu bars, similar to as if I used:
HMENU hmenu = GetMenu()->GetSafeHmenu();

or
HMENU hmenu = ::GetMenu(this->m_hWnd);


I have tried the following to no avail:
CXTPMenuBar* pCXTPMenuBar = GetCommandBars()->GetMenuBar();
HMENU hmenu = pCXTPMenuBar->GetMenu()->GetSafeHmenu();



Does anyone know how I can get the HMENU of my menu for my app???

I'm at a complete loss.



Replies:
Posted By: Oleg
Date Posted: 16 May 2007 at 5:53am
Hi,
 
You can't get it. MenuBar doesn't use HMENU.
You have to call CXTPControls methods to add/remove/modify items to menu.
 
pMenuBar->GetControls()->Add(...)
etc


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net