Ejemplo n.º 1
0
 void UnsafeNativeMethods.IOleInPlaceSite.GetWindowContext(out UnsafeNativeMethods.IOleInPlaceFrame ppFrame, out UnsafeNativeMethods.IOleInPlaceUIWindow ppDoc, NativeMethods._RECT lprcPosRect, NativeMethods._RECT lprcClipRect, 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       = ActiveXHelper.GetClipRect();
     if (lpFrameInfo != null)
     {
         lpFrameInfo.cb            = Marshal.SizeOf(typeof(NativeMethods.tagOIFI));
         lpFrameInfo.fMDIApp       = false;
         lpFrameInfo.hAccel        = IntPtr.Zero;
         lpFrameInfo.cAccelEntries = 0;
         lpFrameInfo.hwndFrame     = (this.Host.Parent == null) ? IntPtr.Zero : this.Host.Parent.Handle;
     }
 }
Ejemplo n.º 2
0
 private int OnActiveXRectChange(NativeMethods._RECT lprcPosRect)
 {
     this.Host.activeXOleInPlaceObject.SetObjectRects(NativeMethods._RECT.FromXYWH(0, 0, lprcPosRect.right - lprcPosRect.left, lprcPosRect.bottom - lprcPosRect.top), ActiveXHelper.GetClipRect());
     this.Host.MakeDirty();
     return(0);
 }
Ejemplo n.º 3
0
 protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
 {
     if (this.activeXState >= ActiveXHelper.ActiveXState.InPlaceActive &&
         this.IsHandleCreated &&
         (((this.Left != x) || (this.Top != y)) || ((this.Width != width) || (this.Height != height))))
     {
         try
         {
             this.activeXBaseChangingSize.Width  = width;
             this.activeXBaseChangingSize.Height = height;
             this.activeXOleInPlaceObject.SetObjectRects(new NativeMethods._RECT(new Rectangle(0, 0, width, height)), ActiveXHelper.GetClipRect());
         }
         finally
         {
             this.activeXBaseChangingSize.Width = -1;
         }
     }
     base.SetBoundsCore(x, y, width, height, specified);
 }