Print Page | Close Window

Popup menu with Tray Icon

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=3103
Printed Date: 04 October 2024 at 9:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Popup menu with Tray Icon
Posted By: fishy
Subject: Popup menu with Tray Icon
Date Posted: 26 October 2005 at 5:28pm
Hey everyone,

I am very new to the toolkit and I am fooling around with some things getting ramped up for a product my company is working on.  I am using the CXTTrayIcon class as in the examples and calling CXTPCommandBars::TrackPopupMenu(CMenu*,..) to display the menu associated with the tray icon.

In my application, I need the menu that pops up to be able to display dynamic content.  In previous MFC (non-codejock apps) this was solved by using ON_UPDATE_COMMAND_UI combined with pCmdUI->m_pMenu->AppendMenu(..).  Trying the same mechanism with my codejock app results in a little different behavior.  In the pure MFC app, the pCmdUI->m_pSubMenu and pCmdUI->m_pMenu members were usable values in some cases (such as when i the update message is passed on a submenu) but in the app with the tray icon, the m_pSubMenu and m_pMenu are always NULL - so I can't use the same technique that I am used to.  Interestingly enough, if i take out the call to CXTPCommandBars::TrackPopupMenu(CMenu*,...) and use the CMenu object's TrackPopupMenu method directly, then none of my ON_UPDATE_COMMAND_UI handlers are called at all.

My question is basically what is the best way to go about making a system tray popup menu that contains dynamic content.  I have tried using CXTPMenuBar, ON_UPDATE_COMMAND_UI, etc.. all without perfect results.  I am sure there is a good way to do this I am just not familiar enough with the toolkit yet.  Suggestions??

- Fishy



Replies:
Posted By: Oleg
Date Posted: 27 October 2005 at 7:09am
Please check Notification and DynamicPopups samples

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