Solved

ReBar control

Posted on 1998-08-12
9
662 Views
Last Modified: 2013-12-03
Hi,
I'm having a little problem getting new ReBar control to work.  I think I've followed the instructions pretty well but it still won't work.
I'll go over what I've been doing:

I call InitCommonControlsEx() specifying ICC_COOL_CLASSES|ICC_BAR_CLASSES.

I create the ReBar control using CreateWindowEx().
hRebar = CreateWindowEx()...
- dwStyle = WS_CHILD|WS_VISIBLE|RBS_BANDBORDERS|CBRS_ALIGN_ANY.
- dwExStyle = WS_EX_TOOLWINDOW.
- hwndParent = m_hWnd (handle to main frame).
- ClassName = REBARCLASSNAME.
The ReBar gets created.

I create a REBARINFO structure, RBinfo.
- cbSize = sizeof(REBARINFO);
- fMask  = 0;
- himl   = (HIMAGELIST)NULL;

Send the ReBar a message to intitialize.
::SendMessage(hRebar, RB_SETBARINFO, 0, (LPARAM)(REBARINFO*)&RBinfo);

I figured that I should have a CWnd around to wrap the ReBar so I have a CWnd member m_wndReBar.
m_wndReBar.Attach(h_Rebar);

Now I create my ToolBar, passing it the wrapper CWnd& of the ReBar as it's owner.
m_wndToolBar.Create(&m_wndReBar);
m_wndToolBar.LoadToolBar(IDR_MAINFRAME));

Now, I want to let the ReBar know that my m_wndToolBar is it's child and will be in the bar.

I create a REBARBANDINFO called RBBinfo.
- cbSize = sizeof(REBARBANDINFO);
- fMask = RBBIM_CHILD  | RBBIM_CHILDSIZE;// child will be ToolBar
- cxMinChild = 100 (arbitrary.  Just testing it)
- cyMinChild = 50  (arbitrary.  Just testing it)
- hwndChild = m_wndToolBar.m_hWnd;  (handle to ToolBar)

Now I send the ReBar a message to add my ToolBar band.
::SendMessage(hRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)(REBARBANDINFO*)&RBBinfo);

After all this, I figured everything would be fine, but the ReBar is not there.  It gets drawn but it's not there.  It's drawn at the top but I can erase the picture of the ReBar (with the ToolBar inside it) with a MDI frame.

What have I done wrong?
Why is the rebar just a picture of a Rebar and no real?

Thanks
0
Comment
Question by:bod_1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 6

Expert Comment

by:WxW
ID: 1413394
If you want I will mail you the Rebar example that I read and modify to suit my rebar
0
 
LVL 2

Expert Comment

by:lucidity
ID: 1413395
There is an excellent rebar control at
http://www.geocities.com/SiliconValley/Haven/8230/index.html
used in the Internet Explorer 4.0 IDE.
0
 

Author Comment

by:bod_1
ID: 1413396
Hey WxW, Lucidity,
wassup?
Yeah, I've seen Kirk Stowell's samples (linked from codeguru), but they all seem to link to his library. Don't get me wrong, he does good stuff, but I just like to write my own code and it's hard to see what the ReBar's doing because of all of the intermediary classes.
I tried it again for a few minutes;
Now I get a fully functional Rebar with a toolbar class (WS_EX_TRANSPARENT) inside it but the toolbar keeps painting over the Rebar's background bitmap.
Also, the ReBar (RBS_AUTOSIZE) doesn't size with the frame window...
WxW, that example would be much appreciated,
it would be good if the ReBar had a control class inside it with a background bmp, or a tip, whatever; just so I can figure out what's going on.

bod_1@hotmail.com

Thanks
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

Author Comment

by:bod_1
ID: 1413397
WxW,
I just went to my mailbox, tried to retreive the zip files but it seems my server is having a few problems.
Thanks for the files though.
I'll post here again when they fix whatever the problem is.
0
 

Author Comment

by:bod_1
ID: 1413398
WxW,
I can't download the zip files.  The server said something about Back Orifice (hehe.  Joke).
Could you mail them to my other account?
gced@passport.ca
Thanks
0
 
LVL 6

Expert Comment

by:WxW
ID: 1413399
done
0
 

Author Comment

by:bod_1
ID: 1413400
Thanks WxW,
Sorry about the time, I was away.

I'll reopen question for you.
Thanks again
0
 

Author Comment

by:bod_1
ID: 1413401
-
0
 
LVL 6

Accepted Solution

by:
WxW earned 50 total points
ID: 1413402
Thanks
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question