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