Esempio n. 1
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] COMRECT pRect);
Esempio n. 2
0
 public static extern bool RedrawWindow(IntPtr hwnd, COMRECT rcUpdate, IntPtr hrgnUpdate, int flags);
Esempio n. 3
0
 public static extern bool EnumDisplayMonitors(System.Runtime.InteropServices.HandleRef hdc, COMRECT rcClip, MonitorEnumProc lpfnEnum, System.IntPtr dwData);
Esempio n. 4
0
 public int ResizeBorder(COMRECT rect, IOleInPlaceUIWindow doc, bool fFrameWindow)
 {
     return(1);
 }
Esempio n. 5
0
        public int DoVerb(int iVerb, IntPtr lpmsg, IOleClientSite pActiveSite, int lindex, IntPtr hwndParent, COMRECT lprcPosRect)
        {
            ComDebug.ReportInfo("{0}.IOleObject.DoVerb {1}", GetType().Name, iVerb);
            try
            {
                // I saw OLEIVERB_HIDE come in as 253.  Perhaps a unsigned
                // byte conversion happening somewhere.
                if (iVerb >= 250 && iVerb <= 255)
                {
                    int new_iverb = iVerb - 256;
                    ComDebug.ReportWarning("{0}.IOleObject.DoVerb -> Fixing iVerb: {1} -> {2}", GetType().Name, iVerb, new_iverb);
                    iVerb = new_iverb;
                }

                _lastVerb = iVerb;

                switch (iVerb)
                {
                case (int)OLEIVERB.OLEIVERB_HIDE:
                    ComDebug.ReportInfo("{0}.IOleObject.DoVerb OLEIVERB_HIDE", GetType().Name);
                    _comManager.ApplicationAdapter.HideMainWindow();
                    SendAdvise_HideWindow();
                    break;

                case (int)OLEIVERB.OLEIVERB_PRIMARY:
                case (int)OLEIVERB.OLEIVERB_SHOW:
                case (int)OLEIVERB.OLEIVERB_OPEN:

                    if ((int)OLEIVERB.OLEIVERB_PRIMARY == iVerb)
                    {
                        ComDebug.ReportInfo("{0}.IOleObject.DoVerb OLEIVERB_PRIMARY", GetType().Name);
                    }
                    if ((int)OLEIVERB.OLEIVERB_SHOW == iVerb)
                    {
                        ComDebug.ReportInfo("{0}.IOleObject.DoVerb OLEIVERB_SHOW", GetType().Name);
                    }
                    if ((int)OLEIVERB.OLEIVERB_OPEN == iVerb)
                    {
                        ComDebug.ReportInfo("{0}.IOleObject.DoVerb OLEIVERB_OPEN", GetType().Name);
                    }
                    _comManager.ApplicationAdapter.ShowMainWindow();
                    if (pActiveSite != null)
                    {
                        ComDebug.ReportInfo("{0}.IOleObject.DoVerb -> calling ClientSite.ShowObject()", GetType().Name);
                        try
                        {
                            pActiveSite.ShowObject();
                        }
                        catch (Exception ex)
                        {
                            ComDebug.ReportInfo("{0}.IOleObject.DoVerb pActiveSite.ShowObject caused an exception: {1}", GetType().Name, ex);
                        }

                        SendAdvise_ShowWindow();
                    }

                    return(ComReturnValue.NOERROR);

                default:
                    ComDebug.ReportError("{0}.IOleObject.DoVerb Unexpected verb: {1}", GetType().Name, iVerb);
                    return(ComReturnValue.OLEOBJ_S_INVALIDVERB);
                }
                ComDebug.ReportInfo("{0}.IOleObject.DoVerb -> returning NOERROR", GetType().Name);
                return(ComReturnValue.NOERROR);
            }
            catch (Exception e)
            {
                ComDebug.ReportError("{0}.IOleObject.DoVerb throw an exception. Details: {1}", GetType().Name, e);
                throw;
            }
        }
 public static extern bool EnumDisplayMonitors(IntPtr hdc, COMRECT rcClip, MonitorEnumProc lpfnEnum, IntPtr dwData);
		public int DoVerb(int iVerb, IntPtr lpmsg, IOleClientSite pActiveSite, int lindex, IntPtr hwndParent, COMRECT lprcPosRect)
		{
			ComDebug.ReportInfo("{0}.IOleObject.DoVerb {1}", this.GetType().Name, iVerb);
			try
			{
				// I saw OLEIVERB_HIDE come in as 253.  Perhaps a unsigned
				// byte conversion happening somewhere.
				if (iVerb >= 250 && iVerb <= 255)
				{
					int new_iverb = iVerb - 256;
					ComDebug.ReportWarning("{0}.IOleObject.DoVerb -> Fixing iVerb: {1} -> {2}", this.GetType().Name, iVerb, new_iverb);
					iVerb = new_iverb;
				}

				_lastVerb = iVerb;

				switch (iVerb)
				{
					case (int)OLEIVERB.OLEIVERB_HIDE:
						ComDebug.ReportInfo("{0}.IOleObject.DoVerb OLEIVERB_HIDE", this.GetType().Name);
						_comManager.ApplicationAdapter.HideMainWindow();
						SendAdvise_HideWindow();
						break;

					case (int)OLEIVERB.OLEIVERB_PRIMARY:
					case (int)OLEIVERB.OLEIVERB_SHOW:
					case (int)OLEIVERB.OLEIVERB_OPEN:

						if ((int)OLEIVERB.OLEIVERB_PRIMARY == iVerb) ComDebug.ReportInfo("{0}.IOleObject.DoVerb OLEIVERB_PRIMARY", this.GetType().Name);
						if ((int)OLEIVERB.OLEIVERB_SHOW == iVerb) ComDebug.ReportInfo("{0}.IOleObject.DoVerb OLEIVERB_SHOW", this.GetType().Name);
						if ((int)OLEIVERB.OLEIVERB_OPEN == iVerb) ComDebug.ReportInfo("{0}.IOleObject.DoVerb OLEIVERB_OPEN", this.GetType().Name);
						_comManager.ApplicationAdapter.ShowMainWindow();
						if (pActiveSite != null)
						{
							ComDebug.ReportInfo("{0}.IOleObject.DoVerb -> calling ClientSite.ShowObject()", this.GetType().Name);
							try
							{
								pActiveSite.ShowObject();
							}
							catch (Exception ex)
							{
								ComDebug.ReportInfo("{0}.IOleObject.DoVerb pActiveSite.ShowObject caused an exception: {1}", this.GetType().Name, ex);
							}

							SendAdvise_ShowWindow();
						}

						return ComReturnValue.NOERROR;

					default:
						ComDebug.ReportError("{0}.IOleObject.DoVerb Unexpected verb: {1}", this.GetType().Name, iVerb);
						return ComReturnValue.OLEOBJ_S_INVALIDVERB;
				}
				ComDebug.ReportInfo("{0}.IOleObject.DoVerb -> returning NOERROR", this.GetType().Name);
				return ComReturnValue.NOERROR;
			}
			catch (Exception e)
			{
				ComDebug.ReportError("{0}.IOleObject.DoVerb throw an exception. Details: {1}", this.GetType().Name, e);
				throw;
			}
		}
Esempio n. 8
0
 public static extern bool RedrawWindow(IntPtr hwnd, COMRECT rcUpdate, IntPtr hrgnUpdate, int flags);
 public void CopyTo(COMRECT destRect) {
     destRect.left = left;
     destRect.right = right;
     destRect.top = top;
     destRect.bottom = bottom;
 }
Esempio n. 10
0
 public static extern int ScrollWindowEx(HandleRef hWnd,
                                         int nXAmount, int nYAmount,
                                         COMRECT rectScrollRegion, ref RECT rectClip,
                                         HandleRef hrgnUpdate, ref RECT prcUpdate, int flags);
Esempio n. 11
0
 public static extern int ScrollWindowEx(HandleRef hWnd,
     int nXAmount, int nYAmount,
     COMRECT rectScrollRegion, ref RECT rectClip,
     HandleRef hrgnUpdate, ref RECT prcUpdate, int flags);
Esempio n. 12
0
 public static extern bool EnumDisplayMonitors(HandleRef hdc, COMRECT rcClip, MonitorEnumProc lpfnEnum, IntPtr dwData);
Esempio n. 13
0
 private static extern bool EnumDisplayMonitors(HandleRef hdc, COMRECT rcClip, MonitorEnumProc lpfnEnum, IntPtr dwData);
Esempio n. 14
0
 int IDocHostUIHandler.ResizeBorder(COMRECT rect, object doc, bool fFrameWindow) => VSConstants.E_NOTIMPL;