I have a little program which I can start from the tools menu in RadAsm. My intention is to insert the color reference of a choosen color at the cursor position in RadAsm. I have tried to create a pipe and I have tried to WM_COPYDATA but not succeeded. What shall I do?

thanks
Posted on 2002-09-25 14:25:05 by minor28
Hi minor28

Nice little tool you have made.
The prefered way is by creating a RadASM addin dll.

Here is a way without creating an addin.

KetilO
Posted on 2002-09-26 01:46:15 by KetilO
Thanks KetilO

Your hint in copytora was a greate help to me. The exe works fine from the tools menu. However, as you said the prefered way was to create an addin dll I now have tried to learn the RadAsm addin technique. That's why it took some time to answer.

Now I have made an addin called colref.dll. It works from a toolbarbutton. The asciitab project has been the model for creating the toolbarbutton.

My addin works in the same way as my exe. But I have one problem that I couldn't solve. When I choose a new color by the menu "New color" and presses the insertbutton the colorref is inserted but RadAsm is deactivated. I don't understand why.

Regards
Minor28
Posted on 2002-10-16 16:33:10 by minor28
Hi minor28

Try to make RadASM the owner of the color dialog.

KetilO
Posted on 2002-10-16 16:59:41 by KetilO
Thanks KetilO,

Now it works. But I found another problem. CTR+V and RadAsm "Paste" activate the dll. I can't paste without activating the dll.
Posted on 2002-10-17 01:38:44 by minor28
Hi minor28

Yes I've just noticed. I will try to find out why.

BTW. Byte values starting with a letter must be proceeded by a zero.

KetilO
Posted on 2002-10-17 01:55:01 by KetilO
Hi minor28

There were a few bugs in the InstallDll proc. This caused the AIM_GETMENUID to fail.
You also used ebx in the DlgProc without preservation.
I also found a better way to solve the focus problem.

Great work minor28. :alright:

KetilO
Posted on 2002-10-17 02:50:25 by KetilO
Hi KetilO

Returning to the probleme of RadAsm beeing deactivated after choosing "New Color" menu. In the new release of RadASM the same operation causes RadASM to deactivate and immediately after that activated. Isn't it better to make RadASM owner of the dialog.

.if eax==IDM_NEW
invoke SetDlgItemText,hWnd,IDC_EDT1,0
invoke SetDlgItemText,hWnd,IDC_EDT2,0
invoke SetDlgItemText,hWnd,IDC_EDT3,0
mov eax,
invoke ColorDLG,(ADDINHANDLES ptr ).hEdit
.elseif eax==IDM_EXIT

Regards
Posted on 2002-10-21 09:20:04 by minor28
Hi minor28

Maybe, but then RadASM gets focus and not the dialog that called the color dialog.

KetilO
Posted on 2002-10-21 09:28:26 by KetilO
Hi

Change focus to the dialog and change editcontrols tabstops to false in the dialogeditor and tabindex=0 to the prefered button, for example "insert" hex.

.if eax==IDM_NEW
invoke SetDlgItemText,hWnd,IDC_EDT1,0
invoke SetDlgItemText,hWnd,IDC_EDT2,0
invoke SetDlgItemText,hWnd,IDC_EDT3,0
mov eax,
invoke ColorDLG,(ADDINHANDLES ptr ).hEdit
invoke SetFocus,hWnd
.elseif eax==IDM_EXIT

How about that?
Posted on 2002-10-21 10:48:43 by minor28
Hi minor28

Yes, that should work.

KetilO
Posted on 2002-10-21 13:26:40 by KetilO
It is my version...
Posted on 2002-10-21 21:25:08 by Eviloid
Hi Eviloid

Very nice, great improvements. :alright:

KetilO
Posted on 2002-10-22 03:26:03 by KetilO
yes Eviloid,

far more sophisticated and professional.

minor28
Posted on 2002-10-22 03:46:32 by minor28
Thanks!
:grin:
Posted on 2002-11-04 00:04:35 by Eviloid