I've Created a Music Player using Visual Studio 2012 Windows Form C#. now I want the user to be able to play songs in windows explorer such as other players(Windows Media Player,Winamp,etc.) with my player. I already found the way to File association!
but I need to prevent my application from running multiple instance(as WMP&... don't) and I want to get the songs Paths too to send them to my application(already started).
For example User Select 3 Songs in a directory in windows explorer & Press Enter so my application / and execute my AddFiles Function (add the supported files to playlist and ...)
I tried mutex it solves the first part(just single instance) but can't get arguments from it!
I also tried this but No chance :( it gave error!
** I already triedWhat is the correct way to create a single instance application? "Matt Davis" Answer and it makes my application to be single instance only and bring to front part was awesome but didn't send arguments to my running process so It couldn't solve my problem!
any Help would be in advance :)
UPDATE: I don't understand while I haven't get my problem solved why experts close the question!? :| :/
UPDATE 2 (FOUND THE SOLUTION):
ok Finally I've got the solution :)
this link helped me to get paths of selected files in explorer by clicking on a context-menu item: .NET Shell Extensions - Shell Context Menus
real easy :) Hope this help others too!