Radasm 3 Addin prgramming

Started by ragdog, May 11, 2011, 10:39:14 PM

Previous topic - Next topic

ragdog

Hi @All

Now have i open this Thread for help, if i have any question to Radasm addin programming
That i not use Radasm bug test Thread.

I have many Ideas About Radasm3 and have added my function to this source and it works fine.
but if change Ketil the version must i all my modification add to the new source an this is many works :bg

Now have i beginning add all my function to a Addin.

Radasm use GetWindowLong,ha.hEdt,GWL_ID to "Retrieves the identifier of the window."
This return the identifier for

;Mdi child editor types
ID_EDITCODE equ 1
ID_EDITTEXT equ 2
ID_EDITHEX equ 3
ID_EDITRES equ 4
ID_EDITUSER equ 5
ID_PROJECT equ 6
ID_EXTERNAL equ 7

;Mdi child ID's
ID_FIRSTCHILD equ 65001
ID_LASTCHILD equ 65499



Radasm code example

.elseif eax==IDM_FORMAT_CENTERVERTICAL
.if ha.hMdi
   invoke GetWindowLong,ha.hEdt,GWL_ID
   .if eax==ID_EDITRES
invoke SendMessage,ha.hEdt,DEM_ALIGNSIZE,0,ALIGN_DLGVCENTER
  .endif
  mov da.fTimer,1
      .endif


My code

.elseif uMsg==AIM_COMMAND
mov edx,wParam
movzx eax,dx
shr edx,16
.if edx==BN_CLICKED && eax==IDM_MYFUNCTION
push ebx
        mov eax,lpData
                mov ebx,[eax].ADDINHANDLES.hEdt
          invoke GetWindowLong,ebx,GWL_ID

.if eax==ID_EDITRES
   invoke TextOutput,CTEXT ("EDITRES selected")
.elseif eax==ID_EDITCODE
invoke TextOutput,CTEXT ("EDITCODE selected")
.endif

mov [eax].ADDINDATA.fTimer,1
        pop ebx
        ret


And must i set the Timer in my Addin ( mov da.fTimer,1)?

Greest,

KetilO

Hi ragdog

This depends on what your addin is doing. The timer updates toolbar, statusbar, tab select tool and reparses a changed code file.

KetilO

ragdog

#2
OK

Solved



    .if uMsg==AIM_MDIACTIVATE
   
      invoke GetWindowLong,hWin,GWL_USERDATA
      mov hEd,eax

    .elseif uMsg==AIM_COMMAND
mov edx,wParam
movzx eax,dx
shr edx,16
.if edx==BN_CLICKED && eax==IDM_MYF
            invoke GetWindowLong,hEd,GWL_ID
.if eax==ID_EDITRES
invoke TextOutput,CTEXT ("EDITRES selected")
.elseif eax==ID_EDITCODE
invoke TextOutput,CTEXT ("EDITCODE selected")
.endif



Thanks again