internal override void CreateAllStyle() { Invariant.Assert(RootBrowserWindow.App != null, "RootBrowserWindow must be created in an Application"); IHostService hostService = (IHostService)RootBrowserWindow.App.GetService(typeof(IHostService)); Invariant.Assert(hostService != null, "IHostService in RootBrowserWindow cannot be null"); Invariant.Assert(hostService.HostWindowHandle != IntPtr.Zero, "IHostService.HostWindowHandle in RootBrowserWindow cannot be null"); UIPermission uipermission = new UIPermission(UIPermissionWindow.AllWindows); uipermission.Assert(); try { base.OwnerHandle = hostService.HostWindowHandle; base.Win32Style = 1174405120; } finally { CodeAccessPermission.RevertAssert(); } }
internal override void CreateAllStyle() { Invariant.Assert(App != null, "RootBrowserWindow must be created in an Application"); IHostService ihs = (IHostService)App.GetService(typeof(IHostService)); Invariant.Assert(ihs != null, "IHostService in RootBrowserWindow cannot be null"); Invariant.Assert(ihs.HostWindowHandle != IntPtr.Zero, "IHostService.HostWindowHandle in RootBrowserWindow cannot be null"); //This sets the _ownerHandle correctly and will be used to create the _sourceWindow //with the correct parent UIPermission uip = new UIPermission(UIPermissionWindow.AllWindows); uip.Assert();//Blessed Assert to set owner handle and to set styles try { this.OwnerHandle = ihs.HostWindowHandle; this.Win32Style = NativeMethods.WS_CHILD | NativeMethods.WS_CLIPCHILDREN | NativeMethods.WS_CLIPSIBLINGS; } finally { CodeAccessPermission.RevertAssert(); } }