System context menu Icon not transparent like WinRAR

Posted by Samir on Stack Overflow See other posts from Stack Overflow or by Samir
Published on 2010-04-05T11:19:25Z Indexed on 2010/04/22 7:13 UTC
Read the original article Hit count: 285

Filed under:
|
|
|

I added a icon at the system context menu(the popped up menu when we right mouse click on any file/foler). But the icon is not transparent(in xp its not notice able, but in vista/win7 it is clearly visible) there is a white background beneath the icon. But WinRAR or TortoiseSVN icons don't have any white background, they are transparent.

I tried the following C++ code:

#define BITMAP_MAIN 201 //in resource.h
BITMAP_MAIN BITMAP "main.bmp" // in .rc file

// showing icon in menu...
HBITMAP imgMain = LoadBitmap( aHinstance, MAKEINTRESOURCE(BITMAP_MAIN) );
SetMenuItemBitmaps ( hSubmenu, uMenuIndex, MF_BYPOSITION, imgMain, imgMain);

[main.bmp is 16X16]

  1. Also the icon(.bmp) is not shown fully in non-english OS.

So is there be any special technique to make the icon in the system context menu transparent like WinRAR?

© Stack Overflow or respective owner

Related posts about contextmenu

Related posts about transparent