在Windows资源管理器上下文菜单图标的白色背景

Ori*_*rta 6 explorer contextmenu shell-extensions

我有一个COM shell扩展,它将一个项添加到Windows资源管理器上下文菜单中,并使用带有透明背景的BMP图像作为图标.

要像我SetMenuItemBitmaps这样设置图像:

[DllImport("user32.dll", ExactSpelling = true)]
internal static extern int SetMenuItemBitmaps(IntPtr hMenu,uint uPosition,uint uFlags,IntPtr hBitmapUnchecked,IntPtr hBitmapChecked);

SetMenuItemBitmaps(owner.hMenu,(uint)pos,Win32.MF_BYPOSITION,bitmap.GetHbitmap(),IntPtr.Zero);
Run Code Online (Sandbox Code Playgroud)

我的问题是这个 - 当图标第一次出现时它看起来很好但是在它上面悬停后图标的背景变成白色(而不是透明)并保持白色直到我重新打开菜单.

我已经尝试在参数"hBitmapUnchecked","hBitmapChecked"中设置两个非默认值 - 但它似乎没有任何区别.结果保持不变.

这是悬停前的图标图像(缩放到400%):

这是悬停后的图标图像:

注意第二张图片周围的白色背景!

到目前为止,我没有在谷歌上找到任何相关内容.是否有其他方法来设置图标,以避免这种烦人的背景?