I am writing a file explorer application for PocketPC, i use
Systems.Diagnostics Process to start application, but is there a way
to when i click on an image/doc/xls it automatically opens it with the
associated app (image viewer/pocket work/pocket excel,etc)?
I try to pass the file name as the parameter to the Process.Start but
it returns an error
Thanks for your help
Paul T.
"mrabie" <mustaf...@gmail.com> wrote in message
news:bb4ae9e1-87b8-46ff...@v67g2000hse.googlegroups.com...
Process myProcess = new Process();
myProcess.StartInfo.FileName = myDocumentsPath + "\\MyFile.doc";
myProcess.Start();
my.StartInfo.UseShellExecute is another property by default will be
true will start the document in the associated editor.
if it is set to false, the process is created directly from the
executable file.
Hope this helps,
Cheers,
Arun
--
Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com
"mrabie" <mustaf...@gmail.com> wrote in message
news:bb4ae9e1-87b8-46ff...@v67g2000hse.googlegroups.com...
"mrabie" <mustaf...@gmail.com> wrote in message
news:bb4ae9e1-87b8-46ff...@v67g2000hse.googlegroups.com...
> I am writing a file explorer application for PocketPC, i use
> Systems.Diagnostics Process to start application, but is there a way
> to when i click on an image/doc/xls it automatically opens it with the
> associated app (image viewer/pocket work/pocket excel,etc)?
Try using the start info property:
Process p = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo(@"\path\to\file.doc", "");
p.StartInfo = startInfo;
p.Start();
This will internally use the native ShellExecuteEx API mentioned by Paul in
another reply to your thread. Hence the file association registry enteries
will be utilised to find the application associated with these files.
Hope this helps,
Christopher Fairbairn