Notification of Toolbar Docking

prokewl
prokewl used Ask the Experts™
on
How can I tell if a toolbar is docking or undocking?  When the toolbar docks or undocks, the child windows shift, so I need to be able to notify them that they have moved.  Docking or undocking a toolbar doesn't seem to generate a WM_MOVE message for some reason.  Does anyone know how to detect that the toolbar has been docked or undocking?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
CControlBar::IsFloating

Author

Commented:
Sorry, I should've been a little more clearer.  Is there a way for me to get the toolbar to send me a message that it is being docked or not docked instead of me polling the toolbar.  Thanks for any help!

Commented:
Hi
Why don't U create UR own class derived from CToolBar and rplace the object of CToolBar with UR tool bar obkject and to tool bar class map the message ON_WM_WINDOWPOSCHANGED
U will get the notification when ever the toolbar moves
Though this is not the exact way but I think it solves UR problem.

Hope this helps
Commented:
Hi!
Try derive your own class from CToolBar and override CalcFixedLayout(...)
for example:
{
CSize sz = CToolBar::CalcFixedLayout(...);
if (IsFloating() != m_bFloating)
{
m_bFloating = IsFloating();
//SendMessage here;
}
}

Commented:
m_bFloating - member of the your derived class

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial