Print Page | Close Window

Adding Shell context menu to command bar popup

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=22991
Printed Date: 24 November 2024 at 12:39pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Adding Shell context menu to command bar popup
Posted By: gregnis@yahoo.com
Subject: Adding Shell context menu to command bar popup
Date Posted: 07 April 2016 at 4:09pm
I'm trying to add Shell context menu as a popup item to a context command bar created using 

GetCommandBars()->TrackPopupMenuEx(
&m_menuPopup,
TPM_LEFTALIGN | TPM_LEFTBUTTON |
TPM_RIGHTBUTTON | TPM_RETURNCMD,
        point.x,
        point.y);

m_menuPopup here has a popup child item that will serve a placeholder for the Shell context menu. 

I tried handling WM_XTP_CONTROLSELECTED or XTP_INITCOMMANDSPOPUP(), and while I'm able to show the Shell menu, multiple problems remain, most likely to the weird combination of command bar and regular menu (for example, I have to use the regular TrackPopupMenu to show the Shell menu, while already in the other GetCommandBars()->TrackPopupMenuEx() ). The result is a crash on Shell menu selection, inability to move away from the Shell menu once it's open etc. 

Can this be done?

One choice is to use a regular parent context menu instead of command bar but that regular menu will not show icons and command accelerators. 

Another thing I thought could be tried was to add Shell menu items to the command bar but I doubt that it would allow to properly process Shell commands.

Thanks in advance.



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