Пример #1
0
        public void ActivateHtml()
        {
            Debug.Assert(this.oleObject != null, "How'd we get here when trident is null!");

            try
            {
                NativeMethods.COMRECT rect = new NativeMethods.COMRECT();
                NativeMethods.GetClientRect(this.hostControl.Handle, rect);
                this.oleObject.DoVerb(NativeMethods.OLEIVERB_UIACTIVATE, NativeMethods.NullIntPtr, (NativeMethods.IOleClientSite) this, 0, this.hostControl.Handle, rect);
            }
            catch (Exception exception)
            {
                Debug.Fail(exception.ToString());
            }
        }
Пример #2
0
 public virtual void SetBorderSpace(NativeMethods.COMRECT pborderwidths)
 {
     throw new COMException(String.Empty, NativeMethods.E_NOTIMPL);
 }
Пример #3
0
 public virtual int OnPosRectChange(NativeMethods.COMRECT lprcPosRect)
 {
     return(NativeMethods.S_OK);
 }
Пример #4
0
 int UnsafeNativeMethods.IDocHostUIHandler.ResizeBorder(NativeMethods.COMRECT rect, UnsafeNativeMethods.IOleInPlaceUIWindow doc, bool fFrameWindow)
 {
     return(NativeMethods.E_NOTIMPL);
 }
Пример #5
0
        private void HostControl_Resize(object src, EventArgs e)
        {
            if (this.documentView != null)
            {
                NativeMethods.COMRECT r = new NativeMethods.COMRECT();

                NativeMethods.GetClientRect(hostControl.Handle, r);
                this.documentView.SetRect(r);
            }
        }
Пример #6
0
 int UnsafeNativeMethods.IOleInPlaceFrame.SetBorderSpace(NativeMethods.COMRECT pborderwidths)
 {
     return(NativeMethods.E_NOTIMPL);
 }
Пример #7
0
 void NativeMethods.IOleInPlaceFrame.SetBorderSpace(NativeMethods.COMRECT pborderwidths)
 {
     throw new COMException(String.Empty, NativeMethods.E_NOTIMPL);
 }
Пример #8
0
 int NativeMethods.IOleInPlaceSite.OnPosRectChange(NativeMethods.COMRECT lprcPosRect)
 {
     return(NativeMethods.S_OK);
 }
Пример #9
0
 public static extern int DrawThemeBackground(HandleRef hTheme, HandleRef hdc, int partId, int stateId, [In] NativeMethods.COMRECT pRect, [In] NativeMethods.COMRECT pClipRect);
Пример #10
0
 public static extern int ScrollWindowEx(HandleRef hWnd, int nXAmount, int nYAmount, NativeMethods.COMRECT rectScrollRegion, ref NativeMethods.RECT rectClip, HandleRef hrgnUpdate, ref NativeMethods.RECT prcUpdate, int flags);
Пример #11
0
 public static extern bool InvalidateRect(HandleRef hWnd, NativeMethods.COMRECT rect, bool erase);
Пример #12
0
 public static extern bool RedrawWindow(HandleRef hwnd, NativeMethods.COMRECT rcUpdate, HandleRef hrgnUpdate, int flags);
Пример #13
0
 public static extern bool EnumDisplayMonitors(HandleRef hdc, NativeMethods.COMRECT rcClip, NativeMethods.MonitorEnumProc lpfnEnum, IntPtr dwData);
Пример #14
0
 int UnsafeNativeMethods.IOleInPlaceFrame.SetBorderSpace(NativeMethods.COMRECT pborderwidths)
 {
     return(-2147467263);
 }
Пример #15
0
        int UnsafeNativeMethods.IOleInPlaceSite.GetWindowContext(out UnsafeNativeMethods.IOleInPlaceFrame ppFrame, out UnsafeNativeMethods.IOleInPlaceUIWindow ppDoc,
                                                                 NativeMethods.COMRECT lprcPosRect, NativeMethods.COMRECT lprcClipRect, NativeMethods.OLEINPLACEFRAMEINFO lpFrameInfo)
        {
            ppDoc   = null;
            ppFrame = this.Host.Container;

            lprcPosRect.left   = (int)this.Host.Bounds.left;
            lprcPosRect.top    = (int)this.Host.Bounds.top;
            lprcPosRect.right  = (int)this.Host.Bounds.right;
            lprcPosRect.bottom = (int)this.Host.Bounds.bottom;

            lprcClipRect = this.Host.Bounds;
            if (lpFrameInfo != null)
            {
                lpFrameInfo.cb            = (uint)Marshal.SizeOf(typeof(NativeMethods.OLEINPLACEFRAMEINFO));
                lpFrameInfo.fMDIApp       = false;
                lpFrameInfo.hAccel        = IntPtr.Zero;
                lpFrameInfo.cAccelEntries = 0;
                lpFrameInfo.hwndFrame     = this.Host.ParentHandle.Handle;
            }

            return(NativeMethods.S_OK);
        }
Пример #16
0
 int UnsafeNativeMethods.IOleInPlaceFrame.GetBorder(NativeMethods.COMRECT lprectBorder)
 {
     return(-2147467263);
 }
Пример #17
0
 public static extern int DrawThemeEdge(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [In] NativeMethods.COMRECT pDestRect, int uEdge, int uFlags, [Out] NativeMethods.COMRECT pContentRect);
Пример #18
0
 void NativeMethods.IOleInPlaceFrame.GetBorder(NativeMethods.COMRECT lprectBorder)
 {
     throw new COMException(String.Empty, NativeMethods.E_NOTIMPL);
 }
Пример #19
0
 public static extern int DrawThemeParentBackground(HandleRef hwnd, HandleRef hdc, [In] NativeMethods.COMRECT prc);
Пример #20
0
 int UnsafeNativeMethods.IOleInPlaceFrame.GetBorder(NativeMethods.COMRECT lprectBorder)
 {
     return(NativeMethods.E_NOTIMPL);
 }
Пример #21
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] NativeMethods.COMRECT pRect);
Пример #22
0
        ///////////////////////////////////////////////////////////////////////////
        // NativeMethods.IOleDocumentSite Implementation
        int NativeMethods.IOleDocumentSite.ActivateMe(NativeMethods.IOleDocumentView viewToActivate)
        {
            Debug.Assert(viewToActivate != null, "Expected the view to be non-null");

            if (viewToActivate == null)
            {
                return NativeMethods.E_INVALIDARG;
            }

            NativeMethods.COMRECT rect = new NativeMethods.COMRECT();
            NativeMethods.GetClientRect(hostControl.Handle, rect);

            this.documentView = viewToActivate;
            this.documentView.SetInPlaceSite((NativeMethods.IOleInPlaceSite) this);
            this.documentView.UIActivate(1);
            this.documentView.SetRect(rect);
            this.documentView.Show(1);

            return NativeMethods.S_OK;
        }
Пример #23
0
 public static extern int GetThemeBackgroundExtent(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [In] NativeMethods.COMRECT pContentRect, [Out] NativeMethods.COMRECT pExtentRect);
Пример #24
0
 public static extern int GetThemeBackgroundRegion(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [In] NativeMethods.COMRECT pRect, ref IntPtr pRegion);
Пример #25
0
 public static extern int GetThemePartSize(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [In] NativeMethods.COMRECT prc, ThemeSizeType eSize, [Out] NativeMethods.SIZE psz);
Пример #26
0
        public virtual void GetWindowContext(out NativeMethods.IOleInPlaceFrame ppFrame, out NativeMethods.IOleInPlaceUIWindow ppDoc, NativeMethods.COMRECT lprcPosRect, NativeMethods.COMRECT lprcClipRect, NativeMethods.tagOIFI lpFrameInfo)
        {
            ppFrame = (NativeMethods.IOleInPlaceFrame) this;
            ppDoc   = null;

            NativeMethods.GetClientRect(parentControl.Handle, lprcPosRect);
            NativeMethods.GetClientRect(parentControl.Handle, lprcClipRect);

            lpFrameInfo.cb            = System.Runtime.InteropServices.Marshal.SizeOf(typeof(NativeMethods.tagOIFI));
            lpFrameInfo.fMDIApp       = 0;
            lpFrameInfo.hwndFrame     = parentControl.Handle;
            lpFrameInfo.hAccel        = IntPtr.Zero;
            lpFrameInfo.cAccelEntries = 0;
        }
Пример #27
0
 public static extern int GetThemeTextExtent(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, [MarshalAs(UnmanagedType.LPWStr)] string pszText, int iCharCount, int dwTextFlags, [In] NativeMethods.COMRECT pBoundingRect, [Out] NativeMethods.COMRECT pExtentRect);
Пример #28
0
        ///////////////////////////////////////////////////////////////////////////
        // IOleInPlaceFrame Implementation

        public virtual void GetBorder(NativeMethods.COMRECT lprectBorder)
        {
            throw new COMException(String.Empty, NativeMethods.E_NOTIMPL);
        }
Пример #29
0
 public static extern int HitTestThemeBackground(HandleRef hTheme, HandleRef hdc, int iPartId, int iStateId, int dwOptions, [In] NativeMethods.COMRECT pRect, HandleRef hrgn, [In] NativeMethods.POINTSTRUCT ptTest, ref int pwHitTestCode);
Пример #30
0
 public virtual int ResizeBorder(NativeMethods.COMRECT rect, NativeMethods.IOleInPlaceUIWindow doc, bool fFrameWindow)
 {
     return(NativeMethods.E_NOTIMPL);
 }
Пример #31
0
        void NativeMethods.IOleInPlaceSite.GetWindowContext(out NativeMethods.IOleInPlaceFrame ppFrame, out NativeMethods.IOleInPlaceUIWindow ppDoc, NativeMethods.COMRECT lprcPosRect, NativeMethods.COMRECT lprcClipRect, NativeMethods.tagOIFI lpFrameInfo)
        {
            ppFrame = (NativeMethods.IOleInPlaceFrame) this;
            ppDoc   = null;

            NativeMethods.GetClientRect(hostControl.Handle, lprcPosRect);
            NativeMethods.GetClientRect(hostControl.Handle, lprcClipRect);

            lpFrameInfo.cb            = Marshal.SizeOf(typeof(NativeMethods.tagOIFI));
            lpFrameInfo.fMDIApp       = 0;
            lpFrameInfo.hwndFrame     = hostControl.Handle;
            lpFrameInfo.hAccel        = NativeMethods.NullIntPtr;
            lpFrameInfo.cAccelEntries = 0;
        }
Пример #32
0
 int UnsafeNativeMethods.IOleInPlaceSite.OnPosRectChange(NativeMethods.COMRECT lprcPosRect)
 {
     return(this.OnActiveXRectChange(lprcPosRect));
 }
Пример #33
0
 public static extern bool RedrawWindow(IntPtr hwnd, NativeMethods.COMRECT rcUpdate, IntPtr hrgnUpdate, int flags);