Bitmaps on MenuItems
- Posted by Euman <euman at bellsouth.net> Jun 28, 2001
- 479 views
Hello all, I thought I would leave this one alone for awhile to give my noodle a rest but when I came back to it, Im still in wonder. Here is a small fragment of code that should place bitmaps on menuitems but it doesnt. LoadImage is not included in this snippet because it is tested elsewhere to be fine code. <snip/> hpopup = c_func(xCreatePopupMenu,{}) mnuclass = allocate(SIZEOF_MENUITEMINFO) poke4(mnuclass + mifSize, SIZEOF_MENUITEMINFO) poke4(mnuclass + mifMask, or_all({MIIM_TYPE,MIIM_ID,MIIM_BITMAP})) poke4(mnuclass + mifType, MF_STRING) poke4(mnuclass + mifState, 0) poke4(mnuclass + miwID, IDM_LONGFORM) poke4(mnuclass + mihsubmenu, NULL) poke4(mnuclass + mihbmpChecked, NULL) poke4(mnuclass + mihbmpUnchecked, NULL) mnustr = alloc_string("&Format\tF7") poke4(mnuclass + midwTypeData, mnustr) poke4(mnuclass + mihbmpItem, LoadImage("format.bmp", IMAGE_BITMAP)) junk = c_func(xInsertMenuItem,{hpopup, 0, 1, mnuclass}) </snip> According to MS-SDK InsertMenuItem will work in this case instead of useing SetMenuItemInfo because I am initially setting the menu up. Has anyone tried to do something similar that might be able to shed light on my little problem? I had a suspicion about * or_all({MIIM_TYPE,MIIM_ID,MIIM_BITMAP}) and mixing these types so, I did try to set MIIM_BITMAP alone and it didnt change a thing. With this code the text will disappears from the menuitem or, the item completely disappears. If you need more to go on (I think I covered most of it), let me know and I can send this to you. Euman euman at bellsouth.net