IVsUIShellOpenDocument::IsDocumentOpen Method (IVsUIHierarchy^, UInt32, String^, Guid, UInt32, IVsUIHierarchy^, array<UInt32>^, IVsWindowFrame^, Int32)

 

Determines whether a document is currently open.

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

int IsDocumentOpen(
	IVsUIHierarchy^ pHierCaller,
	unsigned int itemidCaller,
	String^ pszMkDocument,
	[InAttribute] Guid% rguidLogicalView,
	unsigned int grfIDO,
	[OutAttribute] IVsUIHierarchy^% ppHierOpen,
	array<unsigned int>^ pitemidOpen,
	[OutAttribute] IVsWindowFrame^% ppWindowFrame,
	[OutAttribute] int% pfOpen
)

Parameters

pHierCaller
Type: Microsoft.VisualStudio.Shell.Interop::IVsUIHierarchy^

[in] If the document is open, this is a pointer to the IVsUIHierarchy interface implementation of the project that contains the document. If the document is not open, this is null. You can call Query Interface from IVsUIHierarchy to obtain a pointer to the IVsHierarchy interface of the project. Used with IDO_ActivateIfOpen.

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, for example, the full path to the file. 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.

ppHierOpen
Type: Microsoft.VisualStudio.Shell.Interop::IVsUIHierarchy^

[out] Pointer to the IVsUIHierarchy interface of the project that contains the Open document. If pfOpen is false, then this parameter is null.

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.

ppWindowFrame
Type: Microsoft.VisualStudio.Shell.Interop::IVsWindowFrame^

[out] Pointer to the IVsWindowFrame interface of the window frame that contains the editor in which the document is being edited. If pfOpen is false, then this parameter is null.

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.

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
);
Return to top
Show: