Displaying Files By Using the Open With Command

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Displaying Files By Using the Open With Command.

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.

    System_CAPS_ICON_note.jpg 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.

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

Show: