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 » Removing focus from CExtControlBar Collapse All
Subject Author Date
MUKESH GUPTA Sep 6, 2011 - 7:03 AM

Hi,

I have a SDI application which is using CExtTabWhidbeyWnd to emulate MDI behavior. I also have a few CExtControlBar in the application.

Please suggest, how do I move focus from CExtControlBar to CExtTabWhidbeyWnd.

Thanks in advance.

Technical Support Sep 12, 2011 - 2:51 AM

The main frame window is responsible for handling the WM_SETFOCUS message and setting focus to the selected tab page window. Please check this.

Technical Support Sep 7, 2011 - 2:37 AM

The SetFocus() Win32 API or CWnd::SetFocus() method should be used to set focus to any window. Do you mean how to find the main frame and tab page container inside it? If yes, then AfxGetMainWnd() API returns a pointer to the main frame window and its child window with the AFX_IDW_PANE_FIRST dialog control identifier is the main SDI view that is the tab page container in your project.

MUKESH GUPTA Sep 8, 2011 - 7:26 AM

I tried using SetFocus() before I posted the question here.

If I call SetFocus on the CExtTabWhidbeyWnd object, visibly CExtControlBar looses focus but if I move to some other application and come back to my application, CExtControlBar gains focus again instead of CExtTabWhidbeyWnd getting the focus (I have confirmed that nowhere in my application I am setting focus back to CExtControlBar) on application switch.

Please suggest.