Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. customizing VS.NET 2003

customizing VS.NET 2003

Scheduled Pinned Locked Moved Visual Studio
csharpvisual-studiotutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aryadip
    wrote on last edited by
    #1

    hi everyone, I've written a small application for my company and now would like it to integrate with VS.NET 2003. In the integration part, what I specifically want is to have a menu item placed in the context menu of solution explorer such that whenever the user right clicks on any .cs or .vb file, "Open with myApp" comes as a menu item in the context menu. Can anyone guide me with this? How should I go about doing this? I have seen many applications doing the same, that means this is possible. Some code snippet will be highly appreciated. thanks in advance... Cheers !! and have a Funky day !!

    A 1 Reply Last reply
    0
    • A Aryadip

      hi everyone, I've written a small application for my company and now would like it to integrate with VS.NET 2003. In the integration part, what I specifically want is to have a menu item placed in the context menu of solution explorer such that whenever the user right clicks on any .cs or .vb file, "Open with myApp" comes as a menu item in the context menu. Can anyone guide me with this? How should I go about doing this? I have seen many applications doing the same, that means this is possible. Some code snippet will be highly appreciated. thanks in advance... Cheers !! and have a Funky day !!

      A Offline
      A Offline
      Anna Jayne Metcalfe
      wrote on last edited by
      #2

      You'll have to convert your app to an add-in to achieve this. Once you do, the code to add a command to the context menu of the code window is straightforward:

      try
      {
          Office::CommandBarPtr ptrCodeWindowCommandBar = ptrCommandBars->GetItem(CComVariant(L"Code Window") );
      

      if (ptrCodeWindowCommandBar != NULL)
      {
      Office::CommandBarControlPtr ptrControl = ptrCommand->AddControl(ptrCodeWindowCommandBar, lPos);
      if (ptrControl != NULL)
      {
      Office::_CommandBarButtonPtr ptrButton(ptrControl);
      if (ptrButton != NULL)
      {
      ptrButton->PutStyle(Office::msoButtonAutomatic);
      }
      }
      }
      }
      catch (_com_error& e)
      {
      HRESULT hr = e.Error();
      }

      Writing add-ins can be a difficult task, but ultimately it's rather rewarding. Good luck! If you get stuck there's a Yahoo group devoted to the subject at http://groups.yahoo.com/group/vsnetaddin/[^]. :cool: Anna :rose: Riverblade Ltd - Software Consultancy Services Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups