public Rectangle DrawEdge(IDeviceContext dc, Rectangle bounds, Edges edges, EdgeStyle style, EdgeEffects effects) { if (dc == null) { throw new ArgumentNullException("dc"); } if (!System.Windows.Forms.ClientUtils.IsEnumValid_Masked(edges, (int)edges, 0x1f)) { throw new InvalidEnumArgumentException("edges", (int)edges, typeof(Edges)); } if (!System.Windows.Forms.ClientUtils.IsEnumValid_NotSequential(style, (int)style, new int[] { 5, 10, 6, 9 })) { throw new InvalidEnumArgumentException("style", (int)style, typeof(EdgeStyle)); } if (!System.Windows.Forms.ClientUtils.IsEnumValid_Masked(effects, (int)effects, 0xd800)) { throw new InvalidEnumArgumentException("effects", (int)effects, typeof(EdgeEffects)); } System.Windows.Forms.NativeMethods.COMRECT pContentRect = new System.Windows.Forms.NativeMethods.COMRECT(); using (WindowsGraphicsWrapper wrapper = new WindowsGraphicsWrapper(dc, TextFormatFlags.PreserveGraphicsTranslateTransform | TextFormatFlags.PreserveGraphicsClipping)) { HandleRef hdc = new HandleRef(wrapper, wrapper.WindowsGraphics.DeviceContext.Hdc); this.lastHResult = System.Windows.Forms.SafeNativeMethods.DrawThemeEdge(new HandleRef(this, this.Handle), hdc, this.part, this.state, new System.Windows.Forms.NativeMethods.COMRECT(bounds), (int)style, ((int)(edges | ((Edges)((int)effects)))) | 0x2000, pContentRect); } return(Rectangle.FromLTRB(pContentRect.left, pContentRect.top, pContentRect.right, pContentRect.bottom)); }
public Rectangle GetBackgroundExtent(IDeviceContext dc, Rectangle contentBounds) { if (dc == null) { throw new ArgumentNullException("dc"); } if ((contentBounds.Width < 0) || (contentBounds.Height < 0)) { return(Rectangle.Empty); } System.Windows.Forms.NativeMethods.COMRECT pExtentRect = new System.Windows.Forms.NativeMethods.COMRECT(); using (WindowsGraphicsWrapper wrapper = new WindowsGraphicsWrapper(dc, TextFormatFlags.PreserveGraphicsTranslateTransform | TextFormatFlags.PreserveGraphicsClipping)) { HandleRef hdc = new HandleRef(wrapper, wrapper.WindowsGraphics.DeviceContext.Hdc); this.lastHResult = System.Windows.Forms.SafeNativeMethods.GetThemeBackgroundExtent(new HandleRef(this, this.Handle), hdc, this.part, this.state, new System.Windows.Forms.NativeMethods.COMRECT(contentBounds), pExtentRect); } return(Rectangle.FromLTRB(pExtentRect.left, pExtentRect.top, pExtentRect.right, pExtentRect.bottom)); }
public Rectangle GetTextExtent(IDeviceContext dc, Rectangle bounds, string textToDraw, TextFormatFlags flags) { if (dc == null) { throw new ArgumentNullException("dc"); } if (string.IsNullOrEmpty(textToDraw)) { throw new ArgumentNullException("textToDraw"); } System.Windows.Forms.NativeMethods.COMRECT pExtentRect = new System.Windows.Forms.NativeMethods.COMRECT(); using (WindowsGraphicsWrapper wrapper = new WindowsGraphicsWrapper(dc, TextFormatFlags.PreserveGraphicsTranslateTransform | TextFormatFlags.PreserveGraphicsClipping)) { HandleRef hdc = new HandleRef(wrapper, wrapper.WindowsGraphics.DeviceContext.Hdc); this.lastHResult = System.Windows.Forms.SafeNativeMethods.GetThemeTextExtent(new HandleRef(this, this.Handle), hdc, this.part, this.state, textToDraw, textToDraw.Length, (int)flags, new System.Windows.Forms.NativeMethods.COMRECT(bounds), pExtentRect); } return(Rectangle.FromLTRB(pExtentRect.left, pExtentRect.top, pExtentRect.right, pExtentRect.bottom)); }
public static extern int GetThemeTextExtent(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [MarshalAs(UnmanagedType.LPWStr)] string pszText, int iCharCount, int dwTextFlags, [In] System.Windows.Forms.NativeMethods.COMRECT pBoundingRect, [Out] System.Windows.Forms.NativeMethods.COMRECT pExtentRect);
public static extern int GetThemePartSize(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [In] System.Windows.Forms.NativeMethods.COMRECT prc, ThemeSizeType eSize, [Out] System.Windows.Forms.NativeMethods.SIZE psz);
int UnsafeNativeMethods.IOleInPlaceSite.OnPosRectChange(System.Windows.Forms.NativeMethods.COMRECT lprcPosRect) { return(this.OnActiveXRectChange(lprcPosRect)); }
public Rectangle DrawEdge(IDeviceContext dc, Rectangle bounds, Edges edges, EdgeStyle style, EdgeEffects effects) { if (dc == null) { throw new ArgumentNullException("dc"); } if (!System.Windows.Forms.ClientUtils.IsEnumValid_Masked(edges, (int) edges, 0x1f)) { throw new InvalidEnumArgumentException("edges", (int) edges, typeof(Edges)); } if (!System.Windows.Forms.ClientUtils.IsEnumValid_NotSequential(style, (int) style, new int[] { 5, 10, 6, 9 })) { throw new InvalidEnumArgumentException("style", (int) style, typeof(EdgeStyle)); } if (!System.Windows.Forms.ClientUtils.IsEnumValid_Masked(effects, (int) effects, 0xd800)) { throw new InvalidEnumArgumentException("effects", (int) effects, typeof(EdgeEffects)); } System.Windows.Forms.NativeMethods.COMRECT pContentRect = new System.Windows.Forms.NativeMethods.COMRECT(); using (WindowsGraphicsWrapper wrapper = new WindowsGraphicsWrapper(dc, TextFormatFlags.PreserveGraphicsTranslateTransform | TextFormatFlags.PreserveGraphicsClipping)) { HandleRef hdc = new HandleRef(wrapper, wrapper.WindowsGraphics.DeviceContext.Hdc); this.lastHResult = System.Windows.Forms.SafeNativeMethods.DrawThemeEdge(new HandleRef(this, this.Handle), hdc, this.part, this.state, new System.Windows.Forms.NativeMethods.COMRECT(bounds), (int) style, ((int) (edges | ((Edges) ((int) effects)))) | 0x2000, pContentRect); } return Rectangle.FromLTRB(pContentRect.left, pContentRect.top, pContentRect.right, pContentRect.bottom); }
public Rectangle GetBackgroundExtent(IDeviceContext dc, Rectangle contentBounds) { if (dc == null) { throw new ArgumentNullException("dc"); } if ((contentBounds.Width < 0) || (contentBounds.Height < 0)) { return Rectangle.Empty; } System.Windows.Forms.NativeMethods.COMRECT pExtentRect = new System.Windows.Forms.NativeMethods.COMRECT(); using (WindowsGraphicsWrapper wrapper = new WindowsGraphicsWrapper(dc, TextFormatFlags.PreserveGraphicsTranslateTransform | TextFormatFlags.PreserveGraphicsClipping)) { HandleRef hdc = new HandleRef(wrapper, wrapper.WindowsGraphics.DeviceContext.Hdc); this.lastHResult = System.Windows.Forms.SafeNativeMethods.GetThemeBackgroundExtent(new HandleRef(this, this.Handle), hdc, this.part, this.state, new System.Windows.Forms.NativeMethods.COMRECT(contentBounds), pExtentRect); } return Rectangle.FromLTRB(pExtentRect.left, pExtentRect.top, pExtentRect.right, pExtentRect.bottom); }
public static extern bool RedrawWindow(HandleRef hwnd, System.Windows.Forms.NativeMethods.COMRECT rcUpdate, HandleRef hrgnUpdate, int flags);
public static extern int DrawThemeEdge(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [In] System.Windows.Forms.NativeMethods.COMRECT pDestRect, int uEdge, int uFlags, [Out] System.Windows.Forms.NativeMethods.COMRECT pContentRect);
public static extern int DrawThemeBackground(HandleRef hTheme, HandleRef hdc, int partId, int stateId, [In] System.Windows.Forms.NativeMethods.COMRECT pRect, [In] System.Windows.Forms.NativeMethods.COMRECT pClipRect);
int UnsafeNativeMethods.IOleInPlaceFrame.SetBorderSpace(System.Windows.Forms.NativeMethods.COMRECT pborderwidths) { return(-2147467263); }
int UnsafeNativeMethods.IOleInPlaceFrame.GetBorder(System.Windows.Forms.NativeMethods.COMRECT lprectBorder) { return(-2147467263); }
public static extern int HitTestThemeBackground(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, int dwOptions, [In] System.Windows.Forms.NativeMethods.COMRECT pRect, HandleRef hrgn, [In] System.Windows.Forms.NativeMethods.POINTSTRUCT ptTest, ref int pwHitTestCode);
public static extern int DrawThemeParentBackground(HandleRef hwnd, HandleRef hdc, [In] System.Windows.Forms.NativeMethods.COMRECT prc);
public static extern bool InvalidateRect(HandleRef hWnd, System.Windows.Forms.NativeMethods.COMRECT rect, bool erase);
public static extern int DrawThemeText(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [MarshalAs(UnmanagedType.LPWStr)] string pszText, int iCharCount, int dwTextFlags, int dwTextFlags2, [In] System.Windows.Forms.NativeMethods.COMRECT pRect);
public static extern int ScrollWindowEx(HandleRef hWnd, int nXAmount, int nYAmount, System.Windows.Forms.NativeMethods.COMRECT rectScrollRegion, ref System.Windows.Forms.NativeMethods.RECT rectClip, HandleRef hrgnUpdate, ref System.Windows.Forms.NativeMethods.RECT prcUpdate, int flags);
public static extern bool EnumDisplayMonitors(HandleRef hdc, System.Windows.Forms.NativeMethods.COMRECT rcClip, System.Windows.Forms.NativeMethods.MonitorEnumProc lpfnEnum, IntPtr dwData);
public Rectangle GetTextExtent(IDeviceContext dc, Rectangle bounds, string textToDraw, TextFormatFlags flags) { if (dc == null) { throw new ArgumentNullException("dc"); } if (string.IsNullOrEmpty(textToDraw)) { throw new ArgumentNullException("textToDraw"); } System.Windows.Forms.NativeMethods.COMRECT pExtentRect = new System.Windows.Forms.NativeMethods.COMRECT(); using (WindowsGraphicsWrapper wrapper = new WindowsGraphicsWrapper(dc, TextFormatFlags.PreserveGraphicsTranslateTransform | TextFormatFlags.PreserveGraphicsClipping)) { HandleRef hdc = new HandleRef(wrapper, wrapper.WindowsGraphics.DeviceContext.Hdc); this.lastHResult = System.Windows.Forms.SafeNativeMethods.GetThemeTextExtent(new HandleRef(this, this.Handle), hdc, this.part, this.state, textToDraw, textToDraw.Length, (int) flags, new System.Windows.Forms.NativeMethods.COMRECT(bounds), pExtentRect); } return Rectangle.FromLTRB(pExtentRect.left, pExtentRect.top, pExtentRect.right, pExtentRect.bottom); }
public static extern int GetThemeBackgroundExtent(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [In] System.Windows.Forms.NativeMethods.COMRECT pContentRect, [Out] System.Windows.Forms.NativeMethods.COMRECT pExtentRect);
int UnsafeNativeMethods.IOleInPlaceSite.GetWindowContext(out UnsafeNativeMethods.IOleInPlaceFrame ppFrame, out UnsafeNativeMethods.IOleInPlaceUIWindow ppDoc, System.Windows.Forms.NativeMethods.COMRECT lprcPosRect, System.Windows.Forms.NativeMethods.COMRECT lprcClipRect, System.Windows.Forms.NativeMethods.tagOIFI lpFrameInfo) { ppDoc = null; ppFrame = this.Host.GetParentContainer(); lprcPosRect.left = this.Host.Bounds.X; lprcPosRect.top = this.Host.Bounds.Y; lprcPosRect.right = this.Host.Bounds.Width + this.Host.Bounds.X; lprcPosRect.bottom = this.Host.Bounds.Height + this.Host.Bounds.Y; lprcClipRect = WebBrowserHelper.GetClipRect(); if (lpFrameInfo != null) { lpFrameInfo.cb = Marshal.SizeOf(typeof(System.Windows.Forms.NativeMethods.tagOIFI)); lpFrameInfo.fMDIApp = false; lpFrameInfo.hAccel = IntPtr.Zero; lpFrameInfo.cAccelEntries = 0; lpFrameInfo.hwndFrame = (this.Host.ParentInternal == null) ? IntPtr.Zero : this.Host.ParentInternal.Handle; } return(0); }
public static extern int GetThemeBackgroundRegion(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [In] System.Windows.Forms.NativeMethods.COMRECT pRect, ref IntPtr pRegion);
private int OnActiveXRectChange(System.Windows.Forms.NativeMethods.COMRECT lprcPosRect) { this.Host.AXInPlaceObject.SetObjectRects(System.Windows.Forms.NativeMethods.COMRECT.FromXYWH(0, 0, lprcPosRect.right - lprcPosRect.left, lprcPosRect.bottom - lprcPosRect.top), WebBrowserHelper.GetClipRect()); this.Host.MakeDirty(); return(0); }
int System.Windows.Forms.UnsafeNativeMethods.IDocHostUIHandler.ResizeBorder(System.Windows.Forms.NativeMethods.COMRECT rect, System.Windows.Forms.UnsafeNativeMethods.IOleInPlaceUIWindow doc, bool fFrameWindow) { return(-2147467263); }