When you set the Cancel property of the DockWindowCancelEventArgs in the ActiveWindowChanging event, the active window should not be changed.