Finally,
the experts said there is no way to change the color of a a menubar.
There is. And it is quite easy.
Runs on windows 10 Home 64b.
this one does it directly.
Don't know why.
Runs OK here on Win10 64 Pro.
hutch,
good to know.
The thing is to set the first popupmenu (only the first !) as MF_POPUP or MF_BITMAP or MF_OWNERDRAW.
The bmp is not important. In my case it only sets the menubar to 25 pixels.
Not even an expert like jj ("Colouring the menu bar is not foreseen in Windows afaik)
knew of this easy possibility.
Congrats, the last version works fine :t
jj,
it is almost too easy.
The first and only MF_OWNERDRAW causes the SetMenuInfo function to set the background color of the menubar
mov mi.fMask,MIM_BACKGROUND
mov eax,hBrush
mov mi.hbrBack,eax
Now, in my project I would like to replace all
invoke AppendMenu, ebx,MF_POPUP,esi,chr$("&First popup") .....
with
invoke AppendMenu, ebx,MF_POPUP or MF_BITMAP,esi,bitmaphandle
And to provide the bmps with tooltips
Working on that
A good trick :t
...
hBM1x16 = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(8001));
...
hMenu = CreateMenu();
AppendMenu(hMenu, MF_ENABLED | MF_POPUP | MF_OWNERDRAW | MF_BITMAP, (UINT)0, (LPCTSTR)hBM1x16);
hMenuF = CreatePopupMenu();
AppendMenu(hMenuF, MF_ENABLED | MF_STRING, IDM_EXIT, TEXT("&Exit"));
AppendMenu(hMenu, MF_ENABLED | MF_POPUP | MF_OWNERDRAW, (UINT)hMenuF, TEXT("&File"));
SetMenu(hWnd, hMenu);
Last version.
Found out. If you provide the submenus with a bitmap instead of text, the bitmap gets real strange on click , but works fine