Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Adding Shell context menu to command bar popup
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Adding Shell context menu to command bar popup

 Post Reply Post Reply
Author
Message
gregnis@yahoo.com View Drop Down
Newbie
Newbie


Joined: 19 January 2016
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote gregnis@yahoo.com Quote  Post ReplyReply Direct Link To This Post Topic: Adding Shell context menu to command bar popup
    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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.