CTrackLookButton in StatusBar???

Help me put one of these mouse-sensitive buttons in my statusbar.  I found the CTrackLookButton at codeguru and have used it before on a dialog.  Easy to setup there, but this status bar stuff is giving me a problem.  If you are not familiar with the class, it's just one of those buttons that comes alive when the mouse passes over the button.  Help please.
xlr8tnAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gus012498Commented:
Did you try to create the button with the .Create function?

Regards,
Gus
0
xlr8tnAuthor Commented:
I added the following code after the setpaneinfo stuff:

RECT rc;
m_statusBar.GetItemRect (1, &rc);
m_display_menu.Create(NULL, WS_CHILD | WS_VISIBLE, rc, &m_statusBar, ID_INDICATOR_BUTTON);
m_display_menu.LoadBitmaps(IDB_MENU,IDB_MENU,IDB_MENU);
m_display_menu.SetTextAlignment(CTrackLookButton::AlignRight);

The debug throws me into:

// Derived class is responsible for implementing all of these handlers
//  for owner/self draw controls.
void CStatusBar::DrawItem(LPDRAWITEMSTRUCT)
{
      ASSERT(FALSE);
}
0
Vinayak KumbarSr Program ManagerCommented:
Hi,

Modify Ur code for create as
m_display_menu.Create(NULL, WS_CHILD | WS_VISIBLE | BS_OWNERDRAW , rc, &m_statusBar, ID_INDICATOR_BUTTON);

Try it out.
VinExpert
 
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Vinayak KumbarSr Program ManagerCommented:
Hi,

Follow the steps to achieve that
1. Go to class wizard and add a new class say CMyStatusBar derived from     CStatusBarCtrl.
2. Open MyStatusBar.cpp and .h and replace all the refferences     of CStatusBarCtrl to CStatusBar.
3. Open Mainfrm.h and include MyStatusBar.h file, then change
    CStatusBar m_wndStatusBar; to
    CMyStatusBar  m_wndStatusBar;
    Now U have full control over the status bar, add a pane to it as u have     done.
4. Go to class wizard and add the function for WM_MOUSEMOVE for the class     CMyStatusBar. And function code will be
void CMyStatusBar::OnMouseMove(UINT nFlags, CPoint point)
{
CRect rc;
GetItemRect(1, rc);
if(rc.PtInRect(point))
{
((CMainFrame *)AfxGetMainWnd())->m_display_menu.SendMessage(WM_MOUSEMOVE,0,0);
}
CStatusBar::OnMouseMove(nFlags, point);
}

5. Create the button as
RECT rc;
m_wndStatusBar.GetItemRect (1, &rc);
m_display_menu.Create(NULL, WS_CHILD | WS_VISIBLE | BS_OWNERDRAW | WS_TABSTOP , rc, &m_wndStatusBar, ID_INDICATOR_BUTTON);
m_display_menu.LoadBitmaps(IDB_MENU,IDB_MENU,IDB_MENU);
      m_display_menu.SetTextAlignment(CTrackLookButton::AlignRight);
m_display_menu.ShowWindow(SW_SHOW);
m_display_menu.SetFocus();

That will give u the result.

I have the sample workspace, if u give me Ur emailId, I will send it to u.
Hope this helps.
VinExpert

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xlr8tnAuthor Commented:
VinExpert,
This explanation was great, however, I already have an implementation of CDlgStatusBar and don't have the mainfrm class like doc/view.  I changed the create like you suggested and still don't see the button on the bar.  My email is xlr8tn@erols.com.

thanks,
brent
0
Vinayak KumbarSr Program ManagerCommented:
Hi,

Well. Then it will be difficult for me to find it out. If U pls U can send me Ur workspace at k_bbb100@hotmail.com so that I will take a look at it. But as I will be out of station till sunday, it will be delayed for u. Now u can take the decision based on this. If time is not the constraint for u. then send it to me. Else also send it, so that as soon as I come back, i can take a look at it. Okay?. I will try my best to solve Ur prob.

Cheers,
VinExpert

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.