The MASM Forum

Projects => Rarely Used Projects => RadAsm IDE Support => Topic started by: ragdog on August 23, 2014, 07:28:50 PM

Title: Radasm UpdateAccelerator
Post by: ragdog on August 23, 2014, 07:28:50 PM
Hello Again

I try to change the Accelerator from Menu to call my Function

This works fine
Code: [Select]
mov eax,IDM_FILE_NEW
invoke UpdateAccelerator,eax,VK_F11,FVIRTKEY or FNOINVERT

Code: [Select]

UpdateAccelerator proc uses ebx esi,nID:DWORD,nKey:DWORD,nMod:DWORD

mov ebx,lpHandles
invoke GlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,16384
mov hMem,eax
invoke CopyAcceleratorTable,[ebx].ADDINHANDLES.hAccel,NULL,0
mov nAccel,eax
invoke CopyAcceleratorTable,[ebx].ADDINHANDLES.hAccel,hMem,nAccel
invoke DestroyAcceleratorTable,[ebx].ADDINHANDLES.hAccel
mov eax,nAccel
mov edx,sizeof ACCEL
mul edx
mov esi,hMem
lea esi,[esi+eax]
mov eax,nMod
mov [esi].ACCEL.fVirt,al
mov eax,nKey
mov [esi].ACCEL.key,ax
mov eax,nID
mov [esi].ACCEL.cmd,ax
inc nAccel
invoke CreateAcceleratorTable,hMem,nAccel
mov [ebx].ADDINHANDLES.hAccel,eax
invoke GlobalFree,hMem

UpdateAccelerator endp

Why can i not use my Id from Allocated new menu id ?

Code: [Select]
invoke SendMessage,hWin,AIM_GETMENUID,0,0
mov IDAddIn,eax
mov eax,IDAddIn
invoke UpdateAccelerator,eax,VK_F11,FVIRTKEY or FNOINVERT

Is this a bug?

Title: Re: Radasm UpdateAccelerator
Post by: ragdog on August 24, 2014, 05:32:56 AM

.if eax==IDAddIn && edx==BN_CLICKED was my Mistake  ::)