Author Topic: Radasm3 addin Toolbar problem  (Read 978 times)


  • Member
  • ****
  • Posts: 514
Radasm3 addin Toolbar problem
« on: June 21, 2015, 07:59:54 PM »
Hello KetilO

I coding a new Addin for Radasm 3 and add a button to the toolbar

Code: [Select]
mov esi,[esi].ADDINHANDLES.hTbrMake
mov  tbb.iBitmap,eax
mov tbb.fsState,TBSTATE_ENABLED
mov tbb.fsStyle,TBSTYLE_BUTTON
mov tbb.dwData,0
mov tbb.iString,NULL
invoke SendMessage,esi,TB_ADDBUTTONS,1,ADDR tbb

all works fine but how i can add a tooltip to the button?

i use a dirty way with subclass

Code: [Select]
invoke SetWindowLong,[eax].ADDINHANDLES.hWnd,GWL_WNDPROC,offset OnRadasm_WMNotify

OnRadasm_WMNotify proc hWin:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
mov eax, uMsg
.if eax == WM_NOTIFY
mov ebx,lParam
mov eax,[ebx].NMHDR.code
.if eax == TTN_NEEDTEXT  ;so we must show some tooltip text
mov ecx,[ebx].NMHDR.idFrom  ;what button is sending this message to us?
.if ecx == IDAddIn
mov ebx,lParam
mov eax,offset AppName   ;a offset to our new tooltip string
mov [ebx].TOOLTIPTEXT.lpszText,eax
mov eax,TRUE
invoke CallWindowProc,OldWndProc,hWin, uMsg, wParam, lParam
OnRadasm_WMNotify endp

Can you add a function like Radasm 2 AIM_TBRTOOLTIP?

Or gives a better solution?