Export (0) Print
Expand All

IVsUIShellOpenDocument.AddStandardPreviewer Method

Adds a Web browser to the list of available previewers.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)

int AddStandardPreviewer (
	[InAttribute] string pszExePath,
	[InAttribute] string pszDisplayName,
	[InAttribute] int fUseDDE,
	[InAttribute] string pszDDEService,
	[InAttribute] string pszDDETopicOpenURL,
	[InAttribute] string pszDDEItemOpenURL,
	[InAttribute] string pszDDETopicActivate,
	[InAttribute] string pszDDEItemActivate,
	[InAttribute] uint aspAddPreviewerFlags
)
int AddStandardPreviewer (
	/** @attribute InAttribute() */ String pszExePath, 
	/** @attribute InAttribute() */ String pszDisplayName, 
	/** @attribute InAttribute() */ int fUseDDE, 
	/** @attribute InAttribute() */ String pszDDEService, 
	/** @attribute InAttribute() */ String pszDDETopicOpenURL, 
	/** @attribute InAttribute() */ String pszDDEItemOpenURL, 
	/** @attribute InAttribute() */ String pszDDETopicActivate, 
	/** @attribute InAttribute() */ String pszDDEItemActivate, 
	/** @attribute InAttribute() */ UInt32 aspAddPreviewerFlags
)
function AddStandardPreviewer (
	pszExePath : String, 
	pszDisplayName : String, 
	fUseDDE : int, 
	pszDDEService : String, 
	pszDDETopicOpenURL : String, 
	pszDDEItemOpenURL : String, 
	pszDDETopicActivate : String, 
	pszDDEItemActivate : String, 
	aspAddPreviewerFlags : uint
) : int

Parameters

pszExePath

[in] Full path to the executable file you want to launch for the previewer.

pszDisplayName

[in] Name that appears in the Browse With dialog box.

fUseDDE

[in] Set to true to use Dynamic Data Exchange (DDE). For more information, see Dynamic Responding to Dynamic Data Exchange (DDE)

pszDDEService

[in] Identifies the DDE service.

pszDDETopicOpenURL

[in] Identifies the topic open URL.

pszDDEItemOpenURL

[in] Provides the path to the file that is being browsed.

pszDDETopicActivate

[in] Identifies the topic activate URL.

pszDDEItemActivate

[in] Identifies the topic activate string.

aspAddPreviewerFlags

[in] Sets the viewer to be one of the system defaults. For more information, see __VSASPFLAGS.

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::AddStandardPreviewer(
   [in] LPCOLESTR pszExePath,
   [in] LPCOLESTR pszDisplayName,
   [in] BOOL fUseDDE,
   [in] LPCOLESTR pszDDEService,
   [in] LPCOLESTR pszDDETopicOpenURL,
   [in] LPCOLESTR pszDDEItemOpenURL,
   [in] LPCOLESTR pszDDETopicActivate,
   [in] LPCOLESTR pszDDEItemActivate,
   [in] VSASPFLAGS aspAddPreviewerFlags
);

This method adds a web browser to the list of available previewers that can be launched via OpenStandardPreviewer. Once a previewer has been added, it is persisted in the registry under HKEY_CURRENT_USER.

A VSPackage that wishes to add a standard previewer should put a registry entry under HKEY_LOCAL_MACHINE\...\7.0\AddStandardPreviewer {guidPackage} = "Name of Package" subkey. The name is for debugging purpose only and is not actually used.

At the appropriate time, the environment parses the registry entries and calls ResetDefaults, passing in a value of PKGRF_ADDSTDPREVIEWER for the grfFlags parameter on the VSPackage. At that point the VSPackage should call IVsUIShellOpenDocument::AddStandardPreviewer.

For example, if the environment did not provide Internet Explorer as a standard previewer, you could add a call as follows:

AddStandardPreviewer(L"c:\\program files\\internet explorer\\iexplore.exe",

L"Microsoft Internet Explorer", TRUE, L"IEXPLORE",

L"WWW_OpenURL", L"\"%s\",,0xffffffff,3,,,,",

L"WWW_Activate", L"0xffffffff,0",

ASP_MakeDefault);

Use ASP_UnsetOldDefaults with care because you have to unset the old defaults with ASP_MakeDefault, so that there are never zero defaults. Also, if multiple VSPackages use ASP_UnsetOldDefaults | ASP_MakeDefault, the last VSPackage is the default.

Community Additions

ADD
Show:
© 2015 Microsoft