- The proper way to create rebar and toolbar child windows?
- Posted by Bill Holt on December 25th, 2003
I've been using rebar control and the toolbar control in my own
program (no MFC or other framework is used) according to the Internet
Explorer way. That is, Program Window -> WorkerW (Normal Child Window)
-> RebarWindow32 -> ToolbarWindow32. CreateWindowEx is used to create
all these windows. In the argument, positions, width and height are
all set to zero. As a result, the toolbar, rebar, and WorkerW are
created with zero width and height.
I can see the controls are created correctly with SPY++. And I need
"WorkerW" to handle all messeges from toolbars.
So, is there any suggestion on creating them correctly or resizing
them after creation correctly?
Thanks.
- Posted by Stefano \HappyMan\ on December 25th, 2003
In data 25 Dec 2003 05:10:19 -0800, Bill Holt ha scritto:
Maybe the code present in my little framework (http://www.sgr.info) can be
useful.
Look at the ToolbarObject class, I use the Rebar and Toolbar controls.
Bye
Stefano "HappyMan" (Lake Maggiore - Italy)
--
The Personal Framework for Object Oriented Windows Development (Win32)
http://www.sgr.info
Email happyman69 (at) despammed.com
- Posted by Bill Holt on December 25th, 2003
Thanks for the reply, but i can't download windev.zip from your site,
an HTTP 404 error occurred.
"Stefano \"HappyMan\"" <happyman69@despammed.com> wrote in message news:<mz6ia3s9mo1t$.18a7pzt1ntmpr.dlg@40tude.net>. ..
- Posted by Stefano \HappyMan\ on December 26th, 2003
On 25 Dec 2003 16:59:44 -0800, mailbill@21cn.com (Bill Holt) wrote:
Ops, sorry for the mistake, I've modified the site and not re-upload
the .zip file
Now it is ok :-)
Bye
Stefano "HappyMan" (Lago Maggiore - NO)
--
Personal Web http://www.sgr.info
Email happyman69 (at) despammed.com
- Posted by Bill Holt on December 26th, 2003
Okay, i got windev.zip. I have been reading the code of the
ToolbarObject. That's right my coding is also follow the similar steps
with almost same arguments. But, the difference that I created a child
window (named WorkerW) before whose size is set to 0,0. ToolbarObject
doesn't have a child window "containing" the rebar control.
So my actual question is how to resize the container child window
according to the size of rebar control.
- Posted by Stefano \HappyMan\ on December 27th, 2003
In data 26 Dec 2003 02:04:26 -0800, Bill Holt ha scritto:
Hmm I dont' understand: the rebar control *is* (and must be) contained in a
window (class WindowObject) and in its window procedure in the message
WM_SIZE there is the following code:
// Toolbar present
t=(ToolbarObject*)GetWindowLong(w->hToolbar,GWL_USERDATA);
t->Move(0,0,LOWORD(lParam),HIWORD(lParam));
and
void ToolbarObject::Move(int x,int y,int w,int h)
{
MoveWindow(hRebar,x,y,w,h,TRUE);
SendMessage(hTool,TB_AUTOSIZE,0,0);
}
So in your case in the parent window of the rebar control you have to do
the same.
You can have child windows in the rebar control but in this case you have
to manage different bands.
Bye