[SOLVED] HOWTO: Hide context menu items by actions |
Post Reply |
Author | |
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
Posted: 13 January 2009 at 11:11am |
Hi;
I try to hide context menu items by commandbar actions but with no success. I created a context menu in resource that has no according menu item in the main menu of the application. On right click inside the destination control I call AfxGetMainWnd()->GetCommandBars()->TrackPopupMenu(..., this) On initialization of the main window I add all IDs of the menu items to be hidden later (regardless whether they are contained in the main menu or not) by calling GetCommandBars()->GetActions()->Add(ID). When the context menu pops up all items are still visible. I looked at the ActionsSample but this does not use TrackPopupMenu... What do I have to do? Any ideas. |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
Hi;
No idea? No one who had the same problem??? |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
Check if you call non static version of CommandBars::TrackPopupMenu.
try call TrackPopupMenuEx instead.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
Thanks Oleg!
I already didn't call the static version of TrackPopupMenu but I forgot to provide the CommandBars object. After changing all calls to TrackPopupMenuEx() it works as expected. One last question: I didn't implement commandbars customization yet, so I have to ask whether hidden actions can be switched back visible or not. The latter is preferred in my case! |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
User can't switch it back in customization dialog. You have show them in code.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
That's exactly what I want!
Thanks |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |