This documentation is archived and is not being maintained.

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)

int IsDocumentOpen (
	[InAttribute] IVsUIHierarchy pHierCaller,
	[InAttribute] uint itemidCaller,
	[InAttribute] string pszMkDocument,
	[InAttribute] ref Guid rguidLogicalView,
	[InAttribute] uint grfIDO,
	out IVsUIHierarchy ppHierOpen,
	[OutAttribute] uint[] pitemidOpen,
	out IVsWindowFrame ppWindowFrame,
	out int pfOpen
)
int IsDocumentOpen (
	/** @attribute InAttribute() */ IVsUIHierarchy pHierCaller, 
	/** @attribute InAttribute() */ UInt32 itemidCaller, 
	/** @attribute InAttribute() */ String pszMkDocument, 
	/** @attribute InAttribute() */ /** @ref */ Guid rguidLogicalView, 
	/** @attribute InAttribute() */ UInt32 grfIDO, 
	/** @attribute OutAttribute() */ /** @ref */ IVsUIHierarchy ppHierOpen, 
	/** @attribute OutAttribute() */ UInt32[] pitemidOpen, 
	/** @attribute OutAttribute() */ /** @ref */ IVsWindowFrame ppWindowFrame, 
	/** @attribute OutAttribute() */ /** @ref */ int pfOpen
)
JScript does not support passing value-type arguments by reference.

Parameters

pHierCaller

[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 a null reference (Nothing in Visual Basic). You can call Query Interface from IVsUIHierarchy to obtain a pointer to the IVsHierarchy interface of the project. Used with IDO_ActivateIfOpen.

itemidCaller

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

pszMkDocument

[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

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

grfIDO

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

ppHierOpen

[out] Pointer to the IVsUIHierarchy interface of the project that contains the Open document. If pfOpen is false, then this parameter is a null reference (Nothing in Visual Basic).

pitemidOpen

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

ppWindowFrame

[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 a null reference (Nothing in Visual Basic).

pfOpen

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

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

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