Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtControlBar question Collapse All
Subject Author Date
David Skok Jul 24, 2008 - 1:33 PM

How can I tell if a control bar is visible or represented by a docked tab as opposed to closed and no visible tab shows for the control bar?  What event can I use to know when this status changes?

I need to know this because my app can display a diagnostic control bar using a secret hot key.  The contents of this diagnostic control bar use a timer to request data over a wire.  I do not want the contents to send out the requests if the control bar is not visible at all.  It is ok to update if the control bar is docked and retracted though. 

Technical Support Jul 25, 2008 - 5:54 AM

You can handle the WM_WINDOWPOSCHANGED and WM_SHOWWINDOW messages in your CExtControlBar-derived class and check the control bar’s visibility using the CExtControlBar::IsVisible() method. If the control bar is not visible, it can be auto-hidden (CExtControlBar::AutoHideModeGet()) and control bar’s child window can be displayed outside the control bar window when the user selects a tab item from the auto-hide area. If the control bar is visible and it is non-selected inside a tabbed bar group, its child window is not visible. So, it is easier to handle WM_PAINT and WM_TIMER messages in the control bar’s child window and do the following:

1) Your child window should know whether the timer based updating is on each moment.

2) If the WM_PAINT message is received, then the timer based updating should run.

2) If the WM_TIMER message is received, you should check whether the child window is visible using the IsWindowVisible() API. If the window is not visible, the timer should be stopped. If it’s visible, the data should be updated and window should be re-painted.