Click to See Complete Forum and Search --> : Menu item bitmaps again


JensE
November 15th, 2003, 01:56 PM
I browsed this forum and this page for help in this case, but didn't find what I wanted. :(

I want to add the same (colored) menu item bitmaps to my menu as you can see in the visual c++ 6.0 and the MS Word menu, eg. As you can see in this programs: If the mouse cursor selects the menu item, an item bitmap isn't hilighted but it is shown raised.

I use WinAPI programming and tried SetMenuItemBitmaps().

The bitmaps are displayed, but as you can read in MSDN, SetMenuItemBitmaps() should only be used with checking/unchecking bitmaps, which should be of the colors black and white. By default, white is used as background color and mapped to transparent. If you want to use colored bitmaps with this function, the resulting colors aren't predictable.
Furthermore, bitmaps are cut and aren't aligned correctly to the menu item. They are highlighted but not raised if you select the menu item with the mouse. :mad:

Thus I want to ask you, if there is a way to involve the menu item bitmaps you know from MS word into my program.
If you can do this only by ownerdrawing the whole menu, then how to use ownerdrawing correctly (drawing text, disabled menu items, highlight menu item, raise the bitmap and so on).

Thanks for help! ;)

Marc G
November 15th, 2003, 01:59 PM
The only solution is ownerdrawing, but there are already a lot of free usable code available on CodeGuru. Checkout this page: http://www.codeguru.com/menu/index.shtml

JensE
November 15th, 2003, 02:29 PM
Thanx for this advice, Mark G. Unfortunately I only work with standard WinAPI, the MFC is too much overkill, but on this (very good) site, there seem to be only MFC tuts and source codes.

Maybe I find some stuff in the MSDN library. :)