internal static bool TrySetFormChildWindowStyle(Form form) { long newStyle = (long)USER32.GetWindowLongPtr(form.Handle, GWL_STYLE); if (newStyle == 0) { return(false); } newStyle = (newStyle | WS_CHILD) & ~WS_POPUP; return(USER32.SetWindowLongPtr(form.Handle, GWL_STYLE, (IntPtr)newStyle) != IntPtr.Zero); }
private const uint SRCCOPY = 0xCC0020; // flag for copying a source rectangle directly to a destination rectangle internal static void SetFormOwner(Form form, IntPtr ownerHandle) { USER32.SetWindowLongPtr(form.Handle, GWLP_HWNDPARENT, ownerHandle); }