InsertMenu/AppendMenu - How to add Icons to menu and submenus using C++ and win32

前端 未结 2 1251
无人共我
无人共我 2021-01-13 18:53

I have written a shell extension dll context menu program using C++ and win32 programming. The development environment is Visual Studio 2008 and 2010. In the below sample co

2条回答
  •  礼貌的吻别
    2021-01-13 19:10

    Reading the definition of SetMenuItemBitmap https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setmenuitembitmaps there is not such a thing as a MF_BITMAP flag.

    The options are MF_BYCOMMAND and MF_BYPOSITION. Seems like that you are trying to use MF_BYCOMMAND but have to use the same values already given to the MenuItens.

    You have also to check for the format of the BITMAP. SetMenuItemBitmaps just acepts monochrome. I was googling to do the same and had success here. Thanks for showing the way.

提交回复
热议问题