News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Menu Icons

Started by msmith, January 05, 2006, 05:02:22 AM

Previous topic - Next topic

msmith

My menu icons are working fine except that the "seem" a bit too large. They are 16X16 bitmaps and they "bump into" the text on the right.

What is the maximum bitmap size for menus?

Is there a way to cause the text to move to the right?

MichaelW

I'm not sure about this, but I see no way to control the spacing other than by adjusting the size of the icon (bitmaps). Perhaps you could match the icon size to the sizes returned by GetSystemMetrics for SM_CXMENUCHECK and SM_CYMENUCHECK.

MSDN: GetSystemMetrics

On my system the return values are 17 and 17, and the spacing for a 16x16 icon looks OK.


eschew obfuscation

lamer

You can use bitmaps of any size you want. You only have to adjust menu item width and height on WM_MEASUREITEM and accordingly offset the text rectangle on WM_DRAWITEM.

Regards

zooba

Last time I played with menu bitmaps (albeit in VB) I found that they weren't very nice looking... nothing like the Microsoft programs. It'd be nice of them to document their ownerdrawn function, but in any case, have a look in the Custom Components forum for MenuWOW. It looks very very nice indeed :U

(Incidentally, I wasn't paid for that advertisement either :wink)

msmith

Thanks to all of you. I will probably try lamer's approach.

The MenuWow stuff looks very nice, but as far as I can see, it requires the use of resources. My compiler does not use resources. My menus and bitmaps are all generated with inline code.