my code
var info = new ProcessStartInfo(path);
info.WorkingDirectory = path;
info.WindowStyle = ProcessWindowStyle.Maximized;
var p = Process.Start(info);
it will open a file (.pdf, but could be another type of file later) In some cases, there's no program installed for open it, so it shows me the windows message
Windows can't open this file
and offers me to search some program to open it.
How can I avoid this?
I want to show another message. In try/catch
it doesn't throw any kind of exceptions, so its not working.
I tried, if is only .pdf to detect if there is any program installed with this
var key = Registry.ClassesRoot.OpenSubKey(".pdf");
if(key != null)
// Not installed!
but it's not working. I'm getting a key, but I've uninstalled Foxit reader (and also I've use CCleaner to remove conflicts key, but still have .pdf key)
Please help