public static UIViewSettings GetForWindow(IntPtr hWnd) { IUIViewSettingsInterop uIViewSettingsInterop = (IUIViewSettingsInterop)InteropHelper.GetActivationFactory <IUIViewSettingsInterop>(typeof(UIViewSettings)); Guid guid = typeof(UIViewSettings).GUID; return(uIViewSettingsInterop.GetForWindow(hWnd, ref guid)); }