Floating DocumentWindow does not maintain context when clicking Main Window's menu bar

Docking/MDI for WPF Forum

Posted 11 years ago by Jim Strav
Version: 11.2.0554

I handle the DockSite.WindowActivated event to change my main window's Edit menu options depending on which DocumentWindow is active.  The problem is, when you have a floating DocumentWindow and click the menu in the main window, it activates the currently DocumentWindow that is docked in the main window.  This makes it impossible to access the Edit menu for a floating DocumentWindow.

If you do this in VisualStudio 2010, you'll see the behavior I need.  When clicking the main window's menu bar, the floating DocumentWindow maintains the active state.

Any workarounds or is this fixed in a newer version than the one I have?

Comments (2)

Posted 11 years ago by Jim Strav

I found my own answer here:


The relevant code is:

// By default, WPF menus will acquire Win32 focus for the HwndSource in which they are contained.

// This flag prevents WPF menus from acquiring Win32 focus when they receive WPF focus.
HwndSource.DefaultAcquireHwndFocusInMenuMode = false;

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

Hi Jim,

As you saw, this is a bit out of our control since in WPF, clicking on a window's content will activate the window.  There is also this post in StackOverflow that shows a workaround that can be used with WPF docking window products like ours:


I hope that helps!

Actipro Software Support

The latest build of this product (v24.1.2) 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.