IVsTextManager.GetActiveView(Int32, IVsTextBuffer, IVsTextView) 方法

定义

返回活动或之前的活动视图。Returns the active or previously active view.

public:
 int GetActiveView(int fMustHaveFocus, Microsoft::VisualStudio::TextManager::Interop::IVsTextBuffer ^ pBuffer, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ % ppView);
public:
 int GetActiveView(int fMustHaveFocus, Microsoft::VisualStudio::TextManager::Interop::IVsTextBuffer ^ pBuffer, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ &  ppView);
int GetActiveView(int fMustHaveFocus, Microsoft::VisualStudio::TextManager::Interop::IVsTextBuffer const & pBuffer, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::IVsTextView const & & ppView);
public int GetActiveView (int fMustHaveFocus, Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer pBuffer, out Microsoft.VisualStudio.TextManager.Interop.IVsTextView ppView);
abstract member GetActiveView : int * Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer * IVsTextView -> int
Public Function GetActiveView (fMustHaveFocus As Integer, pBuffer As IVsTextBuffer, ByRef ppView As IVsTextView) As Integer

参数

fMustHaveFocus
Int32

中如果为 true,则返回当前 UI 活动视图。[in] If true, then the current UI active view is returned. 如果为 false,则返回最后一个活动视图,而不考虑此视图当前是否处于活动状态。If false, then the last active view is returned, regardless of whether this view is currently UI active.

pBuffer
IVsTextBuffer

中传递 null pBuffer 以获取以前的活动代码视图,而不考虑它与之关联的文本缓冲区。[in] Pass null for pBuffer to get the previously active code view, regardless of the text buffer that it was associated with. 如果传入缓冲区的有效指针,则将返回该特定缓冲区的最后一个活动视图。If you pass in a valid pointer to a buffer, then you are returned the last active view for that particular buffer.

ppView
IVsTextView

弄指向接口的指针 IVsTextView[out] Pointer to the IVsTextView interface.

返回

Int32

如果该方法成功,则它会返回 S_OKIf the method succeeds, it returns S_OK. 如果该方法失败,则会返回错误代码。If it fails, it returns an error code.

注解

COM 签名COM Signature

从 textmgr:From textmgr.idl:

HRESULT IVsTextManager::GetActiveView(  
   [in] BOOL fMustHaveFocus,  
   [in] IVsTextBuffer *pBuffer,  
   [out] IVsTextView **ppView  
);  

适用于