Compartilhar via


Displaying Files By Using the Open With Command

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

A project can ask the IDE to display the Open With dialog box. This request prompts the user to open a file that has a selection of standard editors. The following steps describe this process.

  1. The project calls OpenStandardEditor, specifying a value of OSE_UseOpenWithDialog for the OSEOpenDocEditor parameter.

  2. Based on the document's file name extension, the IDE determines which editors listed in the Registry can open the specified document and displays this information in the Open With dialog box.

    Note

    Projects that have an intrinsic editor that must be included in the Open With dialog box must register an editor factory for each such editor. Intrinsic editors only function together with a particular type of project, which is enforced in the implementation of the CreateEditorInstance method. The IDE has a built-in editor factory for the core text editor and the binary editor. The IDE also creates an instance of an editor factory on behalf of each registered Windows file association. An example of such a file is Microsoft Word.

  3. As soon as the user selects an item from the Open With dialog box, the IDE then opens the document by calling OpenStandardEditor method. For more information, see How to: Open Standard Editors.

See Also

Opening and Saving Project Items
Displaying Files By Using the Open File Command
How to: Open Standard Editors