The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: xandaz on May 12, 2011, 06:54:17 PM

Title: Adding toolwindow to rebar!!! Can this be done?
Post by: xandaz on May 12, 2011, 06:54:17 PM
    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 :)
Title: Re: Adding toolwindow to rebar!!! Can this be done?
Post by: baltoro on May 12, 2011, 09:29:16 PM
This might help: Drag and Drop (OLE), MSDN (http://msdn.microsoft.com/en-us/library/96826a87(v=vs.80).aspx),...
And,...Creating an Internet Explorer-style Toolbar, MSDN (http://msdn.microsoft.com/en-us/library/bb775452(v=vs.85).aspx),...
And, of course,...Rebar: Information About Programming Elements Used With Rebar Controls, MSDN (http://msdn.microsoft.com/en-us/library/bb774375(v=VS.85).aspx)
Title: Re: Adding toolwindow to rebar!!! Can this be done?
Post by: xandaz on May 15, 2011, 03:56:30 PM
   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
Title: Re: Adding toolwindow to rebar!!! Can this be done?
Post by: baltoro on May 16, 2011, 03:34:34 PM
XANDAZ,
Quote from: XANDAZ...This OLE thing is something ive never done,...
...Well,...yeah,...OLE, in assembly language has got to be excruciatingly painful,...
Title: Re: Adding toolwindow to rebar!!! Can this be done?
Post by: mineiro on May 16, 2011, 10:53:59 PM
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
Title: Re: Adding toolwindow to rebar!!! Can this be done?
Post by: xandaz on May 17, 2011, 10:14:51 PM
    Thanks for the tip mineiro. Obrigadinho pela dica meu irmão. Tá visto que você domina a coisa.
    Bye and laters