CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    18

    UPDATE_COMMAND_UI

    I'm trying to use this macro to update a menu that pops up when the user right click on my tray icon. The Menu is linked to my CDialog derived class and the handler was inserted by ClassWizard. The Dialog recieve MenuInit message before the menu is displayed but does ot call the update code until the user has clicked on the actual item. Whcih is obviously too late. Any ideas whats happening here?

    Regards - Zubair


  2. #2
    Join Date
    May 1999
    Posts
    31

    Re: UPDATE_COMMAND_UI

    Hi,

    I ran into the same problem you are experiencing when I created a system tray app. What I did was instead of using UPDATE_COMMAND_UI, I handled the enabling/disabling, checking/unchecking etc. in the OnTrayNotification() member of the CSystemTray class (it is available on CodeGuru). In the OnTrayNotification() function, a pointer to the menu is retrieved. I used this pointer in conjunction with the menu modification functions to get the job done.

    If you are not using CSystemTray, you can still use the same technique in whatever function handles displaying the menu.

    Daniel.


  3. #3
    Join Date
    Apr 1999
    Location
    Quebec, Canada
    Posts
    39

    Re: UPDATE_COMMAND_UI

    Hi,

    I think you can use Windows message : WM_INITMENUPOPUP to enable menu or not..

    Nath.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured