i am writing a program that launches a random file in a directory. the file can be of any time, but mostly video or image files. each time i launch a file i want to close th
EDIT: Thanks to leppie's comment, I suspect I know the answer: my guess is that you're "starting" something like an image, and it's reusing an existing process to open the document instead of creating a new one.
I've reproduced this with this simple test app:
using System;
using System.Diagnostics;
public class Test
{
static void Main()
{
Process proc = Process.Start("image.tif");
Console.WriteLine(proc == null);
}
}
This prints "true" because it's using dllhost.exe to host the Windows Image Viewer, rather than creating a new process.