Floating Window loses focus / WinForms DockManager

Docking/MDI for Windows Forms Forum

Posted 12 years ago by Reinhardt Software GmbH - Reinhardt Software GmbH
Version: 12.1.0300
Avatar

Good day,

is there any way to keep focus on a floating tool window when the main Window's menu is clicked/activated ?

Thanks and best regards

Marc

Comments (5)

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Marc,

That would need to be done by the control you are clicking.  Our Bars product does handle this for you if you are using it.  But if you are using another menu, then that menu's creator would need to prevent clicks from activating the window.

I believe we handle it in Bars by handling the WM_MOUSEACTIVATE API message and returning MA_NOACTIVATE.


Actipro Software Support

Posted 12 years ago by Reinhardt Software GmbH - Reinhardt Software GmbH
Avatar

Hi,

but it happens also if I use the Actipro Main Menu, like in your demo.

Any idea ?

Thanks and best regards

Marc

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Marc,

The Docking demo uses a normal WinForms menu so the issue will show up there.  Our Bars demo on the other hand uses Docking as well and shows how it does not happen there.


Actipro Software Support

Posted 10 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar

Hi,

the same problem applies when the user switches the application. If the focus is in a docked or MDI window, the window keeps the focus. But the floating window loses its focus and instead another window of the application is focused.

Do you have a workaround for that issue?


Best regards, Tobias Lingemann.

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tobias,

I'm not sure what can be done in that particular scenario.  I believe Windows is activating the main window in that scenario so whatever control last had focus in that window is what gets focus again.  The only possible thing I can think of is that you somehow handle the app's WM_ACTIVATEAPP message and then act to restore focus somehow based on that.  But the problem is that I'm not sure how you can tell if the app is being activated from ways such Alt+Tab or by mouse focus.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.