public SurrogateMdiChild(HookedMdiWindow parent, string title, Rectangle location, bool isResizable, bool isMovable, ISurrogateMdiChildContent childContent) { Contract.Requires(parent != null); Contract.Requires(childContent != null); this.Parent = parent; this.IsResizable = isResizable; this.IsMovable = isMovable; this.ChildContent = childContent; this.Surrogate = new SurrogateMdiChildControl(this); this.Surrogate.Text = title; this.Surrogate.ClientSize = location.Size; this.Surrogate.Location = location.Location; this.Surrogate.CreateControl(); // for some reason, these are re-added despite CreateParams // so we have to remove them here var hwnd = this.Surrogate.Handle; var ws = GetWindowLong(hwnd, GWL_STYLE); ws &= ~(WS_MINIMIZEBOX | WS_MAXIMIZEBOX); ws &= ~(IsResizable ? 0 : WS_THICKFRAME); SetWindowLong(hwnd, GWL_STYLE, ws); // since we changed the window styles, we have to redraw SetWindowPos(hwnd, IntPtr.Zero, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); }
public HookedMdiWindowProxy(HookedMdiWindow parent) { Contract.Requires(parent != null); this.Parent = parent; }
public IHookedMdiWindow GetMdiWindow(IntPtr hWndMdiClient) { var newWindow = new HookedMdiWindow(hWndMdiClient); return(newWindow.GetProxy()); }