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. C / C++ / MFC
  4. Context Menu Extensions

Context Menu Extensions

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 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
    Anil_vvs
    wrote on last edited by
    #1

    Hi all, I have implemented Context Menu Extension on my namespace icon by implementing IContextMenu inteface. I have added 5 custom menus. This works fine for Win2k but I only see the first of this menus if I test it on Win XP. Can anyone tell me what is going wrong here? Thanks and Regards, Anil

    T 1 Reply Last reply
    0
    • A Anil_vvs

      Hi all, I have implemented Context Menu Extension on my namespace icon by implementing IContextMenu inteface. I have added 5 custom menus. This works fine for Win2k but I only see the first of this menus if I test it on Win XP. Can anyone tell me what is going wrong here? Thanks and Regards, Anil

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      Anil_vvs wrote:

      This works fine for Win2k but I only see the first of this menus if I test it on Win XP. Can anyone tell me what is going wrong here?

      Buddy, that impossible to tell witout seeing you source code!

      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

      cheers, Alok Gupta VC Forum Q&A :- I/ IV

      A 1 Reply Last reply
      0
      • T ThatsAlok

        Anil_vvs wrote:

        This works fine for Win2k but I only see the first of this menus if I test it on Win XP. Can anyone tell me what is going wrong here?

        Buddy, that impossible to tell witout seeing you source code!

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV

        A Offline
        A Offline
        Anil_vvs
        wrote on last edited by
        #3

        What I am doing is fairly straightforward.. inside the QueryContextMenu function of my implementation of IContextMenu interface I am passed the menu handle of the context menu thats displayed....I am calling InsertMenuItem with the passed menu handle and each of my menu Items.... I was wondering if there is a registry entry or something of that sort that has to be changed so that we get to see all the menus...

        M 1 Reply Last reply
        0
        • A Anil_vvs

          What I am doing is fairly straightforward.. inside the QueryContextMenu function of my implementation of IContextMenu interface I am passed the menu handle of the context menu thats displayed....I am calling InsertMenuItem with the passed menu handle and each of my menu Items.... I was wondering if there is a registry entry or something of that sort that has to be changed so that we get to see all the menus...

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          Post your code

          --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

          A 1 Reply Last reply
          0
          • M Michael Dunn

            Post your code

            --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

            A Offline
            A Offline
            Anil_vvs
            wrote on last edited by
            #5

            STDMETHODIMP MxSNEShellFolder::QueryContextMenu(HMENU hMenu, UINT uiIndexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) { AFX_MANAGE_STATE(AfxGetStaticModuleState()) m_hMenu = hMenu; m_idCmdFirst = uiIndexMenu; m_id = idCmdFirst; if (CMF_DEFAULTONLY & uFlags) return MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_NULL,0); int i = uiIndexMenu; MxSNECmdMgr cmdMgr; try { if(!cmdMgr.IsConnectedFromShell()) { MENUITEMINFO mii = { 0 }; mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE; mii.wID = idCmdFirst + ID_CONNECT; mii.fType = MFT_STRING; mii.dwTypeData = _T("Menu1"); mii.fState = MFS_ENABLED; InsertMenuItem(hMenu, uiIndexMenu++, TRUE, &mii); mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE; mii.wID = idCmdFirst + ID_SEARCH; mii.fType = MFT_STRING; mii.dwTypeData = _T("Menu2"); mii.fState = MFS_DISABLED; InsertMenuItem(hMenu, uiIndexMenu++, TRUE, &mii); mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE; mii.wID = idCmdFirst + ID_CREATEUSINGTEMPLATE; mii.fType = MFT_STRING; mii.dwTypeData = _T("Menu3"); mii.fState = MFS_DISABLED; InsertMenuItem(hMenu, uiIndexMenu++, TRUE, &mii); mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE; mii.wID = idCmdFirst + ID_DISCONNECT; mii.fType = MFT_STRING; mii.dwTypeData = _T("Menu4"); mii.fState = MFS_DISABLED; InsertMenuItem(hMenu, uiIndexMenu++, TRUE, &mii); mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE; mii.wID = idCmdFirst + ID_ABOUT; mii.fType = MFT_STRING; mii.dwTypeData = _T("Menu5"); mii.fState = MFS_ENABLED; InsertMenuItem(hMenu, uiIndexMenu++, TRUE, &mii); } catch(...) { } return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(i-uiIndexMenu)); }

            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