Hi,

Default menuitem is often displayed as bold text, and I want my popup menu do so too, but I don't find information about it.

Is it some resource statement like MENUITEM, or is is done via code?

Best regards, Sami
Posted on 2002-05-29 08:09:41 by SamiP
You need to use SetMenuItemInfo. With the MENUITEMINFO structure, the fState member should be MFS_DEFAULT which will make it bold. But you can only have one menuitem set to MFS_DEFAULT.
Posted on 2002-05-29 09:55:45 by Will
Otherwise you can use SetMenuDefaultItem (and GetMenuDefaultItem if you need to know which item is the default one)

BOOL SetMenuDefaultItem(

HMENU hMenu,
UINT uItem,
UINT fByPos
);


This API only show the item in bold font, you need to handle by yourself the double-click action.
Posted on 2002-05-29 10:11:22 by LuHa
you can download "arretdezindows" on my site if you want some help, but that's exactly what it is already said.

It's a popupmenu, when you select an item, it set another one as default, and then when you dblclick on the trayicon, it executes a specific command...


--><--www.vombonjour.fr.st

Hope this will help.

Note that the code is uncommented (I'm sorry for that), it's quite not well written (test lines as comment, well, you'll understand)
Posted on 2002-05-29 12:42:22 by Vom-bonjour:-()
Thank you guys!

I used SetMenuDefaultItem as LuHa said and it works, now I'm quite happy with my Network Neighborhood replacement for XP.

Thanks, Sami
Posted on 2002-05-29 13:16:15 by SamiP