Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with inserted popup menu

2 views
Skip to first unread message

rle...@yahoo.com

unread,
Mar 31, 1999, 3:00:00 AM3/31/99
to
Hi,

I have a menu defined in my resource that I want to append to the end of the
specified menu. I use the following code:

BOOL AppendOtherMenu(HWND hWnd, HMENU hMenu)
{
HMENU hNewMenu = LoadMenu(g_hInstance, MAKEINTRESOURCE(IDR_OTHER_MENU));

if (hNewMenu != NULL)
{
MENUITEMINFO mii;

mii.cbSize = sizeof(MENUITEMINFO);
mii.fMask = MIIM_TYPE | MIIM_SUBMENU;
mii.fType = MFT_BITMAP;
mii.hSubMenu = hNewMenu;
mii.dwTypeData = (LPTSTR)g_hOtherMenuBitmap; // loaded from resource
// using LoadBitmap
// 16-color bitmap
// 63x13 pixels

// Append at the end.
InsertMenuItem(hMenu, 0xFFFFFFFF, MF_BYPOSITION, &mii);

DrawMenuBar(hWnd);

return TRUE;
}

return FALSE;
}

Pretty straightforward I think. I have a couple of problems.

1) Normally, popup menus have the right-arrow symbol at the right side to
signify that selecting that menu item causes a popup menu to be displayed, for
example, the "Send To" menu item in Windows Explorer. I don't see that in my
menu. I can see the bitmap and when I select it, the dropdown/popup menu
appears and works fine.

2) My bitmap is a simple picture on a white background. How do I make it
transparent, i.e., display the "white" the same color as the background color
used by the window?

Thanks for your help.

Rico

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

0 new messages