News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Adding toolwindow to rebar!!! Can this be done?

Started by xandaz, May 12, 2011, 06:54:17 PM

Previous topic - Next topic

xandaz

    i'm trying to make a detachable toolbox and things work if i add the toolwindow manually instaead of drag/dropping it into the ReBar. Can someone see what is wrong? Thanks and laterz :)


xandaz

   Well baltoro. That wasnt very helpful. This OLE thing is something ive never done. I dropped the adding of the toolwindow to the toolbar and added just the toolbar inside the toolwindow then heed the toolwindow and it works. Thanks a lot guys. The example is kinda sketchy. I'll clean things up later. Here it goes.
   Thanks a lot guys and laters

baltoro

XANDAZ,
Quote from: XANDAZ...This OLE thing is something ive never done,...
...Well,...yeah,...OLE, in assembly language has got to be excruciatingly painful,...
Baltoro

mineiro

Hello Sr xandaz, in your toolbar you have forgot to put TBSTYLE_TOOLTIPS, after you can send a messaget TB_GETTOLTIPS, and store the handle of tooltip, after set the tooltips to a rebar handle. After this you can deal with notify. These code are based in your 2nd example.

.data
htool dd ?
sametoall dd "empty slot",00h

.code
;ToolboxWndProc  PROC ...
...
            invoke  CreateWindowEx,NULL,addr ToolbarClass,NULL,WS_VISIBLE+WS_CHILD+TBSTYLE_ALTDRAG+TBSTYLE_TOOLTIPS,\
                        0,0,CW_USEDEFAULT,CW_USEDEFAULT,hWnd,NULL,hInstance,NULL
            mov     hToolbar,eax
INVOKE SendMessage,hToolbar,TB_GETTOOLTIPS,0,0
mov htool,eax
invoke SendMessage,hReBar,RB_SETTOOLTIPS,htool,0
...

.ELSEIF uMsg == WM_NOTIFY
mov ebx,lParam
mov eax,[ebx].NMHDR.code
.IF eax == TTN_NEEDTEXT
mov ecx,[ebx].NMHDR.idFrom
;in ecx have the ID of button that send this notify message, deal with it
mov eax,offset sametoall
mov [ebx].TOOLTIPTEXT.lpszText,eax
mov eax,FALSE
ret
.endif

xandaz

    Thanks for the tip mineiro. Obrigadinho pela dica meu irmão. Tá visto que você domina a coisa.
    Bye and laters