IVsRunningDocumentTable2::CloseDocuments Method (UInt32, IVsHierarchy^, UInt32)
Closes one or more documents.
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
int CloseDocuments( unsigned int grfSaveOptions, IVsHierarchy^ pHierarchy, unsigned int docCookie )
Parameters
- grfSaveOptions
-
Type:
System::UInt32
[in] Flags from the __FRAMECLOSE enumeration.
- pHierarchy
-
Type:
Microsoft.VisualStudio.Shell.Interop::IVsHierarchy^
[in] A IVsHierarchy object whose documents are to be closed. See Remarks.
- docCookie
-
Type:
System::UInt32
[in] An abstract value representing the document to be closed. See Remarks.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell80.idl:
HRESULT IVsRunningDocumentTable2::CloseDocuments( [in] FRAMECLOSE grfSaveOptions, [in] IVsHierarchy *pHierarchy, [in] VSCOOKIE docCookie );
The pHierarchy and docCookie parameters are mutually exclusive; only one or the other may be specified. Specifying the pHierarchy parameter closes all open documents in that hierarchy while specifying the docCookie parameter closes only that single document.
The docCookie parameter is the same value that is returned from the FindAndLockDocument or RegisterAndLockDocument methods in the IVsRunningDocumentTable interface.