public static SpatialInteractionManager GetForWindow(IntPtr hWnd)
        {
            ISpatialInteractionManagerInterop spatialInteractionManagerInterop = (ISpatialInteractionManagerInterop)WindowsRuntimeMarshal.GetActivationFactory(typeof(SpatialInteractionManager));
            Guid guid = typeof(SpatialInteractionManager).GUID;

            return(spatialInteractionManagerInterop.GetForWindow(hWnd, ref guid));
        }
        public static SpatialInteractionManager GetForWindow(IntPtr hWnd)
        {
            Guid iid = typeof(SpatialInteractionManager).GUID;
            ISpatialInteractionManagerInterop factory = InteropHelper.GetActivationFactory <ISpatialInteractionManagerInterop>(typeof(SpatialInteractionManager));

            return(factory.GetForWindow(hWnd, ref iid));
        }