Adding Bitmaps to AcEdUIContext

Adding Bitmaps to AcEdUIContext

Anonymous
Not applicable
289 Views
0 Replies
Message 1 of 1

Adding Bitmaps to AcEdUIContext

Anonymous
Not applicable
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
0 Likes
290 Views
0 Replies
Replies (0)