Re: How do I gray out system tray menu entries?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Everyone's answer help me. Your answer explained my problem perfectly. Thank
you! I now have working code.


"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:enhn13p5s0k46nu4h89tsp9sj2ed57rgg4@xxxxxxxxxx
When you do TrackPopupMenu, what window do you specify to handle the
commands? What is
going to happen is that the window you specify is going to be targeted
with
WM_UPDATE_COMMAND_UI messages. The default rule is that if there is a
handler for the
menu item, it will be enabled. So you would have to add an
OnUpdateCommandHandler for
your menu items, and it will be responsible for disabling the item. The
reason it is
being "ignored" is that it is being overridden by the default
OnUpdateCommandUI protocol.
joe

On Tue, 10 Apr 2007 14:17:25 GMT, "Paco" <paco_beams@xxxxxxxxx> wrote:

I want the ability to gray out entries in my system tray menu.

My system tray implementation call a function every time the right mouse
button "up" is detected. This function builds the menu and activates it.
To
create the menu entries I use code lines like this:
::AppendMenu(p_HMenu, MF_STRING, ID_MENU_CONFIGURATION,
"&Configuration..." );

When I want a gray disabled entry, I tried changing code to this:

::AppendMenu(p_HMenu, MF_STRING | MF_GRAYED, ID_MENU_CONFIGURATION,
"&Configuration..." );


It doesn't work. The gray specification seems to be ignored.

How do I get gray menu entries.

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm


.


Quantcast