Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Deactivating a minitoolbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Deactivating a minitoolbar

 Post Reply Post Reply
Author
Message
DavidH View Drop Down
Groupie
Groupie


Joined: 24 March 2007
Status: Offline
Points: 59
Post Options Post Options   Thanks (0) Thanks(0)   Quote DavidH Quote  Post ReplyReply Direct Link To This Post Topic: Deactivating a minitoolbar
    Posted: 04 March 2009 at 9:03am
Hello there!

In my application I use different minitoolbars that should appear depending on what is underneath the mouse.
I'm looking for a way to deactivate the old minitoolbar once the mouse hovers a new screen object. There should always be at most one visible minitoolbar.

For the minitoolbar that should disappear I've tried to set: 
m_bActivated = FALSE;
m_bTracking = FALSE;

but this keeps it visible.

Is there a way to instantly switch it off and make sure it does not come back until I call "TrackMiniBar" again?

David.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 7:43am
Hi,
 
try m_bTracking = FALSE; + manually hide it with ShowWindow(SW_HIDE);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
DavidH View Drop Down
Groupie
Groupie


Joined: 24 March 2007
Status: Offline
Points: 59
Post Options Post Options   Thanks (0) Thanks(0)   Quote DavidH Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 9:56am
Thanks Oleg.

I had to change the approach a bit anyway, because when you have more than one minitoolbar, their PumpMessage loops bring all sorts of new trouble.

I now have just one minitoolbar with all the possible controls, and, depending on what it needs to do, I switch controls on and off by calling their SetVisible method.

It's still tricky enough, as I call the 'TrackMiniBar' method in my 'OnMouseMove' handler in the AppView. As each call to TrackMiniBar initiates its own PumpMessage loop, which starts to handle ON_WM_MOUSEMOVE messages, I should be very careful not to call TrackMiniBar again in the 'OnMouseMove' handler, as it would cause an infinite recursion.

Anyway, I still needed a way to make the minitoolbar invisible, and your tip seems to work fine so far.

David.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.