Professional UI Solutions
Site Map   /  Register
 
 

Forum

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 » Showing a control bar WITHOUT setting focus to it Collapse All
Subject Author Date
Jeremy Richards May 12, 2008 - 10:10 AM

I need to show a (possibly hidden, or buried in a stack of tabs) CExtControlBar window.


I can do this easily enough, with

CMainFrame * pMainFrame = . . .;
CExtControlBar * pBar = . . .;
pMainFrame->SendMessage( WM_COMMAND, WPARAM( pBar->GetDlgCtrlID() ) );


However, this also moves the focus to that window which I do not want.


Is there any way to show the docking window without moving the focus to it?  I dug through the code a little and it seems like there is some sort of message that could be interecepted to modify this behavior, but it wasn’t clear to me exactly which window was getting this message or how to handle it.


 


 

Technical Support May 13, 2008 - 11:43 AM

Thank you for the interesting question. You can simply invoke the CFrameWnd::ShowControlBar() method for a resizable control bar which is not in the auto-hidden mode (CExtControlBar::AutoHideModeGet()) or for a dynamic resizable control bar which is not in the auto-hidden mode and not in the document mode (CExtDynamicControlBar::BarStateGet()).

You can also use the current WM_COMMAND based method. The CExtControlBar window receives a CExtControlBar::g_nMsgQueryFocusChangingEnabled registered message with a pointer to the CExtControlBar::QueryFocusChangingEnabled_t data structure in the WPARAM parameter. You can handle this message and set the CExtControlBar::QueryFocusChangingEnabled_t::m_bFocusChangingEnabled property to false. This won’t allow the focus to be set to the control bar’s child window.