title: Visual Studio 2010 Plug-in - Adding a context-menu to the Editor Window
body: <p>This is similar to the following question: <a href="https://stackoverflow.com/questions/3017063/visual-studio-2010-plug-in-adding-a-context-menu-to-the-solution-explorer">Visual Studio 2010 Plug-in - Adding a context-menu to the Solution Explorer</a>, however my query is how to add the item to the context menu item to the code editor window for JavaScript files.</p>
  
  <p>I am attempting to add the context menu in with a Visual studio Add-in project (not a Visual studio package).</p>
  
  <p>The code from the above link has been supremely helpful. To summarise, to add an item to the context menu of the Solution Explorer and Project explorer, we do so first by retrieving the items themselves:</p>
  
  <pre><code>CommandBars cmdBars = (CommandBars)(_applicationObject.CommandBars);
  CommandBar vsBarProject = cmdBars["Project"];
  CommandBar vsBarSolution = cmdBars["Solution"];
  </code></pre>
  
  <p>And later on, adding them adding them in by augmenting the readily available project template code:</p>
  
  <pre><code>command.AddControl(vsBarProject);
  command.AddControl(vsBarSolution);
  </code></pre>
  
  <p>Now my query is regarding which of the <code>cmdBars</code> elements I have to add the command to, in order for my item to appear on the context menu for editing script files</p>
  
  <p>I have already established its not <code>cmdBars["Code Window"]</code>. Is there one item for all files, or do I have to add it for each editor type (e.g. ASPX, Script, HTML, etc)?</p>