Hi,
I have created a service (solved last problem) but now have a different problem.
My application is intended to scan a directory for PDF files, and if one is created display the PDF to the screen by calling the windows association (as below);
I know that this code works (tested in a normal app); however because I have created this as a service, the Acrobat.exe program that is executed by the code above is hidden (or certainly it is running but not displayed on the screen).Code:private void fileSystemWatcher1_Created(object sender, System.IO.FileSystemEventArgs e) { ProcessStartInfo psi = new ProcessStartInfo(); psi.CreateNoWindow = false; psi.FileName = fileSystemWatcher1.Path + "\\" + e.Name.ToString(); psi.RedirectStandardOutput psi.ErrorDialog = true; psi.UseShellExecute = true; psi.WindowStyle = ProcessWindowStyle.Normal; System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo = psi; p.Start(); }
Does anybody know a way around this? I have searched through the System.Diagnostics.Process members and also the ProcessStartInfo members and can find nothing!
Please please can somebody help me!
Regards,
DJ




Reply With Quote