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. AddContextMenuItem multiple files

AddContextMenuItem multiple files

Scheduled Pinned Locked Moved C#
comtools
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.
  • C Offline
    C Offline
    Clickok
    wrote on last edited by
    #1

    How I do to select multiple files in Windows Explorer, and run one command like "Execute", and all files need be passed as multiple parameters to one application. I have tried the function AddContextMenuItem in this article: http://www.codeproject.com/tools/cpzipstripper.asp but works only to one instance, if I try multiselect files and click "Execute", opens multiple instances of my application, instead of one instance with multiples args... Thank you for all

    M 1 Reply Last reply
    0
    • C Clickok

      How I do to select multiple files in Windows Explorer, and run one command like "Execute", and all files need be passed as multiple parameters to one application. I have tried the function AddContextMenuItem in this article: http://www.codeproject.com/tools/cpzipstripper.asp but works only to one instance, if I try multiselect files and click "Execute", opens multiple instances of my application, instead of one instance with multiples args... Thank you for all

      M Offline
      M Offline
      MilesAhead
      wrote on last edited by
      #2

      There are two approaches that come to mind. First is write a dynamic shell context menu handler that stores all the files selected in the IShellExtInit::Initialize method. This is pretty easy in C++ using one of the wizards you can find here on the Code Project. In C# it's a bit more hairy though. The easier approach in C# would be to modify your app so that it only runs a single instance and any additional instances just pass the command line to the first instance. I'm pretty sure there are examples here of C# single instance apps. Then it's just a matter of passing the command line info. Search on single instance apps in C# here and you should get some working code so you can see various methods to pass info from one instance to another.

      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