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. How to start a single instance of application through selected multiple associated files

How to start a single instance of application through selected multiple associated files

Scheduled Pinned Locked Moved C#
helpwindows-admindata-structurestutorialquestion
3 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.
  • L Offline
    L Offline
    Lyfkcd
    wrote on last edited by
    #1

    Anyone pls help? -- I've built an application that would deal with own associated files.., had done providing default icons, file type, and etc. Everything works well by clicking or selecting a single file, my application runs and accepts the parameter which is the full path of the file itself..., but the problem is, when i try to load multiple selected files, when i do that, multiple instances of my application starts each having a single file to open... Though i'm using a string array in the main function of the application, it just loads a single parameter not an array of parameters..., I've used functions to access the registry, and used "%1" as an Argument, so maybe that could be the main problem.... -- Is there anyway i could change this to other values to attain multiple file entries with one instance of my application? Such as Windows Media Player enlisting all files when you use Ctrl+A in a directory of music files..., ----Thanks a lot in advance!!!!

    S 1 Reply Last reply
    0
    • L Lyfkcd

      Anyone pls help? -- I've built an application that would deal with own associated files.., had done providing default icons, file type, and etc. Everything works well by clicking or selecting a single file, my application runs and accepts the parameter which is the full path of the file itself..., but the problem is, when i try to load multiple selected files, when i do that, multiple instances of my application starts each having a single file to open... Though i'm using a string array in the main function of the application, it just loads a single parameter not an array of parameters..., I've used functions to access the registry, and used "%1" as an Argument, so maybe that could be the main problem.... -- Is there anyway i could change this to other values to attain multiple file entries with one instance of my application? Such as Windows Media Player enlisting all files when you use Ctrl+A in a directory of music files..., ----Thanks a lot in advance!!!!

      S Offline
      S Offline
      Skippums
      wrote on last edited by
      #2

      Perhaps you could acquire a mutex with the first instance of your application. Then, successive attempts to open a duplicate of your application would see that the mutex is already acquired (meaning you have 1 instance of your app already running), and you could send the file path to that instance, then exit the new one. Hope this helps, -Jeff

      L 1 Reply Last reply
      0
      • S Skippums

        Perhaps you could acquire a mutex with the first instance of your application. Then, successive attempts to open a duplicate of your application would see that the mutex is already acquired (meaning you have 1 instance of your app already running), and you could send the file path to that instance, then exit the new one. Hope this helps, -Jeff

        L Offline
        L Offline
        Lyfkcd
        wrote on last edited by
        #3

        I'm sorry, can you pls elaborate? M not sure i got it... ===sorry, just a little of a beginner man(Jeff).

        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