Installing Addin Manager:

IMPORTANT:
You need RadASM 2.0.3.1 or higher.

Copy AddinMana.dll to C:\RadASM\Addins
In RadASM.ini section add:

x=AddinMana.dll,1

Where x is next free number.

What does Addin Manager do:

The addin manager lets you install/uninstall addins and set addin options on the fly.

NOTE:
Only the included addins fully support this.

KetilO

23.08.2003, 16 dl, Fixed a bug that caused duplicate addins in RadASM.ini
24.08.2003, 17 dl, Added more addins that fully support addin manager.
25.08.2003, 20 dl, Added addin version info and date to addin manager.
Posted on 2003-08-22 18:01:16 by KetilO
Hi Ketil,

I was trying to install the code to my addins and ran into a problem. Once my addin is uninstalled, it no longer recieves the AIM_COMMAND message if it is re-installed. The uninstall goes without a hitch but when it calls InstallDLL again it's as if it does not check the return value. This is my DllProc:
DllProc	PROC hWin :DWORD, uMsg :DWORD, wParam :DWORD, lParam :DWORD

cmp uMsg, AIM_COMMAND
jnz @F
mov eax, wParam
cmp RES2DLGID, eax
jnz _end
mov eax,lpHandles
mov eax,[eax].ADDINHANDLES.hWnd
invoke DialogBoxParam,hInstance,200,eax,addr DialogProc,NULL
invoke CloseResFile
mov eax,TRUE
ret

@@:
cmp uMsg, AIM_CLOSE
jnz @F
mov eax,lpData
mov ecx,4
add ecx,[eax].ADDINDATA.fMaximized
mov eax,lpHandles
invoke GetSubMenu,[eax].ADDINHANDLES.hMenu,ecx
invoke DeleteMenu,eax,RES2DLGID,MF_BYCOMMAND

@@:
cmp uMsg, AIM_INITMENUPOPUP
jnz _end
mov eax, lpData
mov eax, [eax].ADDINDATA.fProject
xor eax, 1
or eax, MF_BYCOMMAND
invoke EnableMenuItem, hSubMenu, RES2DLGID, eax
_end:
xor eax, eax
ret
DllProc ENDP

Return value from InstalDll:

mov eax, RAM_COMMAND or RAM_INITMENUPOPUP or AIM_CLOSE
ret

AddInString BYTE "Enable Res2Dlg",0
AddinOpt ADDINOPT <OFFSET AddInString,1,1>
ADDINOPT <0,0,0>
The menu item is reinstalled and the routines are called but AIM_COMMAND is no longer sent to the DLL.
Posted on 2003-08-22 19:41:17 by donkey
Mmmm,

BitMask seems to work fine with it:
Posted on 2003-08-22 19:58:42 by donkey
It also has problems with reinstalling NoteTools. This is the unistaller, it is a little complicated as it has windows to destroy and subclassing to remove:
.ELSEIF eax == AIM_CLOSE

push edi
push esi
invoke GetWindowLong,hPrpLst,GWL_WNDPROC
.IF Options & 1
invoke SetWindowLong,hPrpLst,GWL_WNDPROC,OldLBProc
.ENDIF

.IF Options & 8
mov eax,lpHandles
mov eax,[eax].ADDINHANDLES.hToolBar
invoke SendMessage,eax,TB_GETTOOLTIPS,0,0
invoke SendMessage,eax,TTM_SETTIPBKCOLOR,DefTipColor,0

mov eax,lpHandles
mov eax,[eax].ADDINHANDLES.hPrpTbr
invoke SendMessage,eax,TB_GETTOOLTIPS,0,0
invoke SendMessage,eax,TTM_SETTIPBKCOLOR,DefTipColor,0

mov eax,lpHandles
mov eax,[eax].ADDINHANDLES.hPbrTbr
invoke SendMessage,eax,TB_GETTOOLTIPS,0,0
invoke SendMessage,eax,TTM_SETTIPBKCOLOR,DefTipColor,0
.ENDIF

mov eax, lpHandles
invoke GetSubMenu,[eax].ADDINHANDLES.hToolMenu,4
mov hSubMenu,eax
invoke GetMenuItemCount,hSubMenu
mov esi,eax
; Find the position of the menu item
; in order to be able to remove the separator
; that was added above it
xor edi,edi
.REPEAT
invoke GetMenuItemID,hSubMenu,edi
.BREAK .IF eax == IDAddIn
inc edi
.UNTIL edi == esi
dec edi
invoke DeleteMenu,hSubMenu,edi,MF_BYPOSITION
invoke DeleteMenu,hSubMenu,IDAddIn,MF_BYCOMMAND

invoke DestroyWindow,hToolTip
pop esi
pop edi
Posted on 2003-08-23 00:11:34 by donkey
Hi donkey

There is a bug in the Addin Manager. Sometimes it creates duplicate entries in the ini file. Maybe this is the problem. I am working on finding and fixing the bug.

KetilO
Posted on 2003-08-23 04:39:12 by KetilO
Hi all

New upload at the top.

- Fixed a bug that caused duplicate addins in RadASM.ini

KetilO
Posted on 2003-08-23 06:15:45 by KetilO
Hi Ketil,

The duplicate entry problem is fixed but my addins still do not respond to certain messages. I think this is a problem with Windows in the case of NoteTools as the Subclassing works fine (I get messages) but WM_NOTIFY is not sent. For Res2Dlg I am looking for the problem.
Posted on 2003-08-23 11:24:26 by donkey
Hi Ketil,

Well, I can't figure it out. I have attached Res2Dlg with the modifications for AddIn manager. If you uninstall it then reinstall it it will no longer recieve AIM_COMMAND messages, it still gets the AIM_CLOSE and adds the menu item but AIM_COMMAND is not sent to it at all.

Updated the attachment to a working version
Posted on 2003-08-23 12:05:15 by donkey
Hi donkey

The problem is that GetSystemSizes does not preserve edi. Add uses edi to this proc and it works just fine.
Addin Manager assumes that ebx, esi and edi are preserved as usual.

KetilO
Posted on 2003-08-23 14:17:27 by KetilO
Hi all

New upload at the top.

- Added more addins to the list of addins that fully support addin manager.

KetilO
Posted on 2003-08-24 05:59:25 by KetilO
Hi all

New upload at the top.

- Added addin version info and date to addin manager.

KetilO
Posted on 2003-08-25 03:16:18 by KetilO