I have an application built with WPF using .Net framework 4.8 and windows APIs which runs as a windows application and opens an excel app (separate excel process) and from the excel app opens up a VSTO built using WPF which opens up another window, with in that window there is a functionality to open another window on top.
This workflow works fine for most of the users and environment, but sometime the application crashes intermittently for some users.
when I checked for the error I could find a trace of error in event viewer with below details
.NET Runtime: Application: appname.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.ComponentModel.Win32Exception at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean, System.Nullable`1) at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr) at System.Windows.Interop.HwndTarget.HandleMessage(MS.Internal.Interop.WindowMessage, IntPtr, IntPtr) at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
I tried running and debugging but unfortunately I am not able to reproduce or pinpoint the exact root cause of the issue as the error above doesn't specify exactly what is triggering this error and though I am using windows API to adjust the size and position of the window but not directly using UpdateWindowPos or UpdateWindowSettings from the windows API.
I am kind stuck at the issue and would like some advice or direction to go forward.