Process.Start set FileActivatedEventArgs.NeighboringFilesQuery
When I want to open a file with its default application I simply use:
ProcessStartInfo startInfo = new ProcessStartInfo() {
FileName = filePath,
WorkingDirectory = new FileInfo(filePath).DirectoryName
};
Process.Start(startInfo);
But there is a problem: When I play an MP4 file from a directory within the windows explorer, the file is opened using Microsoft Movies & TV. But also the app gets information about other files in the same directory because there is the possibility to go to the next video. This only works when I am in the given directory inside the windows explorer when opening. When I use for example quick access to open the file I cannot go to other files although there are other videos inside the directory.
I created a blank console app to print all the parameters and then I opened an MP4 file with it:
static void Main(string[] args) {
Console.WriteLine(args.Length);
Console.WriteLine();
foreach (string s in args)
Console.WriteLine(s);
Console.ReadKey();
}
But no matter where I open this app from (within the directory, quick access), it always outputs:
1
D:\Videos\Video1.mp4
So the same parameters lead to different app behavior.
So where does this additional information come from and how to add it using Process.Start? Is there something registered within the registry which parameters should be passed to a given app? If so, how to get this information?
Edit:
Okay, I found the reason. It's the FileActivatedEventArgs.NeighboringFilesQuery. Now there is the question of how to pass this query when starting the process