Just a little tidbit of information for potential addin authors...

While I was doing the favourites menu I noticed that if you add a menu to RadASM with your addin (a menu not a menu item) it will appear gray even if the user has selected colored menus with the RadToolbar addin. In order to correct this you can add the following to your code to make your menu the same as all the others:

[b]; Add the following to InstallDLL[/b]

; assumes that the ADDINHANDLES pointer is in [lpHandles]

; If this is WinNT4 or Win95 the Get/SetMenuInfo functions
; are not available and will not execute.
invoke GetModuleHandle,"User32.dll"
mov ebx,eax
invoke GetProcAddress,ebx,"SetMenuInfo"
mov [pSetMenuInfo],eax
invoke GetProcAddress,ebx,"GetMenuInfo"
mov [pGetMenuInfo],eax

; be sure our menu has the same appearance as the others
mov D[menui.cbSize],SIZEOF MENUINFO
mov D[menui.fmask],MIM_BACKGROUND
mov eax,[lpHandles]
mov eax,[eax+ADDINHANDLES.hMenu]
invoke GetSubMenu,eax,1
invoke GetMenuInfo,eax,offset menui
invoke SetMenuInfo,[hFavMenu],offset menui


In order to make it NT4/Win95 compatible we must wrap the GetMenuInfo and SetMenuInfo functions. Add the following two procs to your code:

SetMenuInfo	FRAME hMenu,lpcmi


mov eax,[pSetMenuInfo]
or eax,eax
jz >.EXIT
push [lpcmi]
push [hMenu]
call eax
.EXIT

ret
ENDF

GetMenuInfo FRAME hMenu,lpcmi

mov eax,[pGetMenuInfo]
or eax,eax
jz >.EXIT
push [lpcmi]
push [hMenu]
call eax
.EXIT

ret
ENDF
Posted on 2004-03-25 01:54:15 by donkey