tags:

views:

63

answers:

3

I have a handle to a Menu . I can change the text of each menu item by using API

SetMenuItemInfo

Now some of the menu's are in bold. I want to change their font to regular. What is the best way to do that?

A: 

Checkout this url:

http://www.xs4all.nl/~rjg70/vbapi/ref/s/setmenuiteminfo.html

Also, the msdn page for this:

http://msdn.microsoft.com/en-us/library/ms648001(VS.85).aspx

Codygman
I already know msdn links to SetMenuItemInfo
Alien01
That's good, but some people might not. I don't think my response deserved a -1 though. I'm assuming you and Alex are the same person and you changed accounts.
Codygman
A: 

You can ask any window to change its font by sending it WM_SETFONT. (Which may not work for menu's, not sure.)

You can use an owner-drawn menu to have full control over its appearance.

Alex
okay I can send message WM_SETFONT to menu window and then how can I set the text.I used SetMeuItemInfo after sending WM_SETFONT but its not working.
Alien01
Use `MFT_STRING` in the `MENUITEMINFO` struct.
Alex
A menu isn't a window though so I doubt this is going to work.
Rob
Good point. [padding]
Alex
A: 

Bold entries in a menu are the default entries (if the menu is not completely ownerdrawn).

You can change this SetMenuDefaultItem().

Stefan