(Howto) Add a bitmap to a menu
Posted: 9 Jun 2006 9:01
Here are the code snippets to add a bitmap into the main menu item.
Call this in the taskWindow:
You can get very nice looking menus as illustrated below.
You can see more by downloading the Axon Idea Processor from:
http://web.singnet.com.sg/~axon2000/download.htm
Chan Bok
Axon Research
Call this in the taskWindow:
Code: Select all
onInitMenu() = handled(0):-
MenuH = gui_native::getMenu(vpi::getTaskWindow()),
Hinst = vpi::getAttrVal(attr_win_instance),
CyCx = gui_native::getMenuCheckMarkDimensions(),
Cx = bit::getLow16of32(CyCx),
Cy = bit::getHigh16of32(CyCx),
LR_COPYFROMRESOURCE=0x4000,
MenuID = (your menu Id),
ResID = (your res Id),
HBmp = gui_native::loadImage(Hinst,uncheckedConvert(string,ResId),
0,Cx,Cy,LR_COPYFROMRESOURCE),
_ = setMenuItemBitmaps(MenuH,MenuID,0,HBmp,HBmp).
You can see more by downloading the Axon Idea Processor from:
http://web.singnet.com.sg/~axon2000/download.htm
Chan Bok
Axon Research