Print Page | Close Window

How can i dynamic add menu iterm

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1018
Printed Date: 15 July 2025 at 4:42am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How can i dynamic add menu iterm
Posted By: powerlinm
Subject: How can i dynamic add menu iterm
Date Posted: 05 August 2004 at 3:59am

I want insert a dynamic  menu to File menu, but failt, this is some code i write in CMainFrame::OnCreate, 

CMenu *pMenuBar1  = pCmdUI->m_pMenu;
 if (pMenuBar1 == NULL)
 {
  return;
 }
 CMenu *pSubMenu = pMenuBar1->GetSubMenu(0);
 ASSERT_VALID(pSubMenu);
 pSubMenu->InsertMenu(5, MF_STRING | MF_ENABLED | MF_BYPOSITION, 0, "hello");

 

that does'nt work,  who can tell me how to do!?




Replies:
Posted By: spike
Date Posted: 05 August 2004 at 6:31pm
They have a message specifically for this....something like XT_WM_INITPOPUPMENU or XT_WM_CREATECONTROLS, XT_WM_CREATECOMMANDBAR, something like that. Search through the samples for OnCreateControls or OnInitPopupMenu...



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