Print Page | Close Window

Context Menu

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=1796
Printed Date: 08 July 2024 at 1:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Context Menu
Posted By: dcolak
Subject: Context Menu
Date Posted: 16 February 2005 at 5:32pm
I've been trying to use Command Bars to create a context menu. This is the code I'm using in OnContextMenu:

    CMenu menu;

    menu.LoadMenu( IDR_SQLBAR );

    CMenu* pMenu = menu.GetSubMenu(0);

    CXTPPopupBar popup;

    popup.LoadMenu( pMenu );

    popup.Popup( point.x, point.y, 0 );

Unfortunatelly, all this does is to flash the popup (it dissapears at once). Is there a sample for creating Context Menus?




Replies:
Posted By: Oleg
Date Posted: 16 February 2005 at 11:52pm
 ClientToScreen(&point);
 CMenu mnu;
 mnu.LoadMenu(IDR_MAINFRAME);
 CXTPCommandBars::TrackPopupMenu(&mnu, TPM_RIGHTBUTTON , point.x, point.y, AfxGetMainWnd(), 0, 0);

 



-------------
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