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#
  4. Contextmenu Shell Extension problem

Contextmenu Shell Extension problem

Scheduled Pinned Locked Moved C#
linuxdebuggingtoolshelp
2 Posts 1 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.
  • L Offline
    L Offline
    Larantz
    wrote on last edited by
    #1

    Hi everyone. I'm currently working on a larger system that will incorporate several tools including shell extensions. The contextmenu works fine for when I rightclick single files. All menuitems show, and InvokeCommand is called to do the work assosiated with the menuitem clicked. But if I select several files, the contextmenu shows, the submenuitems shows and are selectable, but nothing happends. I got a debugger in InvokeCommand() so I know it isn't called. Seems to me that there's some kind of pointer / reference mismatch so that explorer isn't firing my InvokeCommand method. If anyone has some experience in contextmenu shell extensions I'd appreciate some feed back. I'll gladly post some code too if it helps. -Larantz-

    L 1 Reply Last reply
    0
    • L Larantz

      Hi everyone. I'm currently working on a larger system that will incorporate several tools including shell extensions. The contextmenu works fine for when I rightclick single files. All menuitems show, and InvokeCommand is called to do the work assosiated with the menuitem clicked. But if I select several files, the contextmenu shows, the submenuitems shows and are selectable, but nothing happends. I got a debugger in InvokeCommand() so I know it isn't called. Seems to me that there's some kind of pointer / reference mismatch so that explorer isn't firing my InvokeCommand method. If anyone has some experience in contextmenu shell extensions I'd appreciate some feed back. I'll gladly post some code too if it helps. -Larantz-

      L Offline
      L Offline
      Larantz
      wrote on last edited by
      #2

      Solved it. I'll post the solution incase anyone else runs into the same problem. My extension is made up with dynamic contextmenus that vary in size and content according to the filetype etc. So I had identifier baseIDs like i.e: baseIDTxt 0, baseIDDoc 100, baseIDRtf 200; These baseIDs are then used when creating/populating the menus so it's easier to locate the correct commands when InvokeCommand is called. I'd just switch on the baseids: case baseIDTxt + 0: //menuitem index 0 //do something to txt file break; case baseIDTxt + 1: //menuitem index 1 //do something else to txt file break; The problem for me was that if I used a baseID larger then 100 for some of my menus, and the InvokeCommand for that specific contextmenu wouldn't show. So try and keep them below 100 and you should be fine. I now have a dynamic contextmenu with dynamic number of sumbmenuitems that varies for 4 filecases. I used four bases i.e: baseX = 0, baseY = 25, baseZ = 75 and baseLast = 100; -Larantz-

      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