This project has moved. For the latest updates, please go here.
2
Vote

avalondock invalid window handle

description

Hi, my tester is getting such an exception after having the app longer time in background:

System.ComponentModel.Win32Exception

Message:
Neplatný popisovač okna ------> it means "invalid window handle"

Stack Trace:
at MS.Win32.UnsafeNativeMethods.GetParent(HandleRef hWnd)
at System.Windows.Interop.HwndHost.CalculateAssignedRC(PresentationSource source)
at System.Windows.Interop.HwndHost.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at Xceed.Wpf.AvalonDock.Controls.LayoutAutoHideWindowControl.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndHost.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

NativeErrorCode:
1400

ErrorCode:
-2147467259

TargetSite:
IntPtr GetParent(System.Runtime.InteropServices.HandleRef)

Source:
WindowsBase

HResult:
-2147467259

it is perhaps corrected in the 2.9.0 plus edition. is there some solution for the community edition?

Thanks, Ludek.

comments

lalle1 wrote Jun 10, 2016 at 8:09 AM

We get the same problem with version 2.8 on windows 2012

BoucherS wrote Jun 10, 2016 at 7:57 PM

Hi,

I suggest you wait for v2.9 and try it again.
v2.9 OpenSource should be released shortly.

Boumbles wrote Jul 6 at 4:19 PM

We are still getting this in v2.9.0. I've added a catch for Win32Exception in the override of WndProc in LayoutAutoHideWindowControl to avoid crashes but I don't feel this is an optimal solution

Boumbles wrote Jul 6 at 4:35 PM

In particular. We get this if the application is running and the user accesses the machine it's running on via remote desktop. This only occurs if the machine is on Windows 10, OR Windows 7 and has some sort of desktop management software installed (eg: DisplayFusion).