News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Radasm UpdateAccelerator

Started by ragdog, August 23, 2014, 07:28:50 PM

Previous topic - Next topic

ragdog

Hello Again

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

This works fine
mov eax,IDM_FILE_NEW
invoke UpdateAccelerator,eax,VK_F11,FVIRTKEY or FNOINVERT




UpdateAccelerator proc uses ebx esi,nID:DWORD,nKey:DWORD,nMod:DWORD
LOCAL hMem:HGLOBAL
LOCAL nAccel: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
ret

UpdateAccelerator endp



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

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?


Regards,

ragdog

Solved

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