次の方法で共有


IVsUIShellOpenDocument.IsDocumentOpen Method

Determines whether a document is currently open.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function IsDocumentOpen ( _
    pHierCaller As IVsUIHierarchy, _
    itemidCaller As UInteger, _
    pszMkDocument As String, _
    ByRef rguidLogicalView As Guid, _
    grfIDO As UInteger, _
    <OutAttribute> ByRef ppHierOpen As IVsUIHierarchy, _
    <OutAttribute> pitemidOpen As UInteger(), _
    <OutAttribute> ByRef ppWindowFrame As IVsWindowFrame, _
    <OutAttribute> ByRef pfOpen As Integer _
) As Integer
'Usage
Dim instance As IVsUIShellOpenDocument 
Dim pHierCaller As IVsUIHierarchy 
Dim itemidCaller As UInteger 
Dim pszMkDocument As String 
Dim rguidLogicalView As Guid 
Dim grfIDO As UInteger 
Dim ppHierOpen As IVsUIHierarchy 
Dim pitemidOpen As UInteger()
Dim ppWindowFrame As IVsWindowFrame 
Dim pfOpen As Integer 
Dim returnValue As Integer 

returnValue = instance.IsDocumentOpen(pHierCaller, _
    itemidCaller, pszMkDocument, rguidLogicalView, _
    grfIDO, ppHierOpen, pitemidOpen, _
    ppWindowFrame, pfOpen)
int IsDocumentOpen(
    IVsUIHierarchy pHierCaller,
    uint itemidCaller,
    string pszMkDocument,
    ref Guid rguidLogicalView,
    uint grfIDO,
    out IVsUIHierarchy ppHierOpen,
    uint[] pitemidOpen,
    out IVsWindowFrame ppWindowFrame,
    out int pfOpen
)
int IsDocumentOpen(
    [InAttribute] IVsUIHierarchy^ pHierCaller, 
    [InAttribute] unsigned int itemidCaller, 
    [InAttribute] String^ pszMkDocument, 
    [InAttribute] Guid% rguidLogicalView, 
    [InAttribute] unsigned int grfIDO, 
    [OutAttribute] IVsUIHierarchy^% ppHierOpen, 
    [OutAttribute] array<unsigned int>^ pitemidOpen, 
    [OutAttribute] IVsWindowFrame^% ppWindowFrame, 
    [OutAttribute] int% pfOpen
)
function IsDocumentOpen(
    pHierCaller : IVsUIHierarchy, 
    itemidCaller : uint, 
    pszMkDocument : String, 
    rguidLogicalView : Guid, 
    grfIDO : uint, 
    ppHierOpen : IVsUIHierarchy, 
    pitemidOpen : uint[], 
    ppWindowFrame : IVsWindowFrame, 
    pfOpen : int
) : int

Parameters

  • itemidCaller
    Type: System.UInt32

    [in] Hierarchy item identifier of the document in the project. Used with IDO_ActivateIfOpen. For more information, see VSITEMID.

  • pszMkDocument
    Type: System.String

    [in] String form of the unique moniker identifier of the document in the project system. If the document is a file, you can simply specify the file extension for this parameter rather than the full path to the file (for example, .bmp or txt). In non-file cases, this identifier is often in the form of a URL.

  • rguidLogicalView
    Type: System.Guid%

    [in] GUID identifying the logical view. For a list of logical view GUIDS, see Logical View and Physical View.

  • grfIDO
    Type: System.UInt32

    [in] Flags that control what actions are performed on an open document. For more information, see __VSIDOFLAGS.

  • pitemidOpen
    Type: array<System.UInt32[]

    [out] Pointer to the hierarchy item identifier of the open document in the project system. For more information see VSITEMID.

  • pfOpen
    Type: System.Int32%

    [out, retval] true if the document is currently open; false if the document is not open.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsUIShellOpenDocument::IsDocumentOpen(
   [in] IVsUIHierarchy *pHierCaller,
   [in] VSITEMID itemidCaller,
   [in] LPCOLESTR pszMkDocument,
   [in] REFGUID rguidLogicalView,
   [in] VSIDOFLAGS grfIDO,
   [out] IVsUIHierarchy **ppHierOpen,
   [out] VSITEMID *pitemidOpen,
   [out] IVsWindowFrame **ppWindowFrame,
   [out, retval] BOOL *pfOpen
);

.NET Framework Security

See Also

Reference

IVsUIShellOpenDocument Interface

IVsUIShellOpenDocument Members

Microsoft.VisualStudio.Shell.Interop Namespace