Message 1 of 1
Adding Bitmaps to AcEdUIContext

Not applicable
05-16-2008
05:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all!
Is it possible to add bitmaps to the contextmenu?
Because I tried several ways but it did not work.
When right clicking in ACAD the menu appears having
images, but my own added submenu does not.
Here is a snippet of the code, maybe I am doing
something wrong, but this solution worked for other
menus in my application:
MENUITEMINFO ItemInfo;
ZeroMemory(&ItemInfo, sizeof(ItemInfo));
ItemInfo.cbSize = sizeof(MENUITEMINFO);
ItemInfo.fMask = MIIM_BITMAP;
//HBITMAP hBmp = (HBITMAP)LoadImage(NULL, csIconPath, IMAGE_BITMAP, 16,
// 16, LR_LOADFROMFILE);
HBITMAP hBmp = LoadBitmap(AfxGetInstanceHandle(),
//MAKEINTRESOURCE(IDB_BITMAP1));
ItemInfo.hbmpItem = hBmp;
pMenu->GetSubMenu(0)->SetMenuItemInfo(10000 + i, &ItemInfo, FALSE);
Thanks in advance
Markus Griesser
Is it possible to add bitmaps to the contextmenu?
Because I tried several ways but it did not work.
When right clicking in ACAD the menu appears having
images, but my own added submenu does not.
Here is a snippet of the code, maybe I am doing
something wrong, but this solution worked for other
menus in my application:
MENUITEMINFO ItemInfo;
ZeroMemory(&ItemInfo, sizeof(ItemInfo));
ItemInfo.cbSize = sizeof(MENUITEMINFO);
ItemInfo.fMask = MIIM_BITMAP;
//HBITMAP hBmp = (HBITMAP)LoadImage(NULL, csIconPath, IMAGE_BITMAP, 16,
// 16, LR_LOADFROMFILE);
HBITMAP hBmp = LoadBitmap(AfxGetInstanceHandle(),
//MAKEINTRESOURCE(IDB_BITMAP1));
ItemInfo.hbmpItem = hBmp;
pMenu->GetSubMenu(0)->SetMenuItemInfo(10000 + i, &ItemInfo, FALSE);
Thanks in advance
Markus Griesser