コード例 #1
0
 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));
 }
コード例 #2
0
 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));
 }
コード例 #3
0
 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));
 }
コード例 #4
0
 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);
コード例 #5
0
 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);
コード例 #6
0
 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);
 }
コード例 #9
0
 public static extern bool RedrawWindow(HandleRef hwnd, System.Windows.Forms.NativeMethods.COMRECT rcUpdate, HandleRef hrgnUpdate, int flags);
コード例 #10
0
 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);
コード例 #11
0
 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);
コード例 #12
0
 int UnsafeNativeMethods.IOleInPlaceFrame.SetBorderSpace(System.Windows.Forms.NativeMethods.COMRECT pborderwidths)
 {
     return(-2147467263);
 }
コード例 #13
0
 int UnsafeNativeMethods.IOleInPlaceFrame.GetBorder(System.Windows.Forms.NativeMethods.COMRECT lprectBorder)
 {
     return(-2147467263);
 }
コード例 #14
0
 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);
コード例 #15
0
 public static extern int DrawThemeParentBackground(HandleRef hwnd, HandleRef hdc, [In] System.Windows.Forms.NativeMethods.COMRECT prc);
コード例 #16
0
 public static extern bool InvalidateRect(HandleRef hWnd, System.Windows.Forms.NativeMethods.COMRECT rect, bool erase);
コード例 #17
0
 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);
コード例 #18
0
 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);
コード例 #19
0
 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);
 }
コード例 #21
0
 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);
コード例 #22
0
 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);
 }
コード例 #23
0
 public static extern int GetThemeBackgroundRegion(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [In] System.Windows.Forms.NativeMethods.COMRECT pRect, ref IntPtr pRegion);
コード例 #24
0
 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);
 }
コード例 #25
0
 int System.Windows.Forms.UnsafeNativeMethods.IDocHostUIHandler.ResizeBorder(System.Windows.Forms.NativeMethods.COMRECT rect, System.Windows.Forms.UnsafeNativeMethods.IOleInPlaceUIWindow doc, bool fFrameWindow)
 {
     return(-2147467263);
 }