|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)
int OpenStandardPreviewer ( [InAttribute] unsigned int ospOpenDocPreviewer, [InAttribute] String^ pszURL, [InAttribute] VSPREVIEWRESOLUTION resolution, [InAttribute] unsigned int dwReserved )
int OpenStandardPreviewer ( /** @attribute InAttribute() */ UInt32 ospOpenDocPreviewer, /** @attribute InAttribute() */ String pszURL, /** @attribute InAttribute() */ VSPREVIEWRESOLUTION resolution, /** @attribute InAttribute() */ UInt32 dwReserved )
function OpenStandardPreviewer ( ospOpenDocPreviewer : uint, pszURL : String, resolution : VSPREVIEWRESOLUTION, dwReserved : uint ) : int
[in] Bitwise flags that indicate how the previewer is opened. These flags control whether the Browse With dialog box is used (). For more information, see .
[in] URL of the document to preview.
[in] Resolution enumeration that determines the resolution in which the browser windows are to be displayed (if supported). Values are taken from theenumeration.
[in] Reserved for future use. Set to a null reference (Nothing in Visual Basic).
Return ValueIf the method succeeds, it returns . If it fails, it returns an error code.
HRESULT IVsUIShellOpenDocument::OpenStandardPreviewer( [in] VSOSPFLAGS ospOpenDocPreviewer, [in] LPCOLESTR pszURL, [in] VSPREVIEWRESOLUTION resolution, [in] DWORD dwReserved );
A project with items that can be previewed (viewed in a browser) is responsible for implementing thecommand handler. This method should be used in the body of the command handler to cause the browser or browsers to be launched. Call this method to support the Browse With command, which is available from a project system that has enabled the cmdidPreviewInBrowser or cmdidBrowseWith commands. These commands allow the Browse With command to appear if the user attempts to open a file type for which you support opening a browser (previewer).
When a user chooses Browse With, call IVsUIShellOpenDocument.OpenStandardPreviewer to open the Browse With dialog box. The user can select from the list of browsers that are registered. To populate the Browse With dialog box with a specific browser, your VSPackage must call grfFlagsparameter. For example, you might want to use this approach to add a special emulator for your product.when the environment calls the implementation of your VSPackage with a value of in the
The environment supports multiple default browsers. Therefore, this command can cause multiple browsers to be launched. The user controls which browsers is opened using the "Browse With..." dialog box.