execute one program from another

  • Thread starter Thread starter carmen
  • Start date Start date
C

carmen

Is it possible to execute one program from another? I don't know if there is
something like "shellexecute..."
Thanks
Carmen
 
carmen said:
Is it possible to execute one program from another? I don't know if there is
something like "shellexecute..."
Thanks
Carmen

OpenNETCF.Diagnostics.Process.Start

www.opennetcf.org

Or, I think it's in codedll.dll as "CreateProcess", but I haven't used
that version in a year or so since OpenNETCF has been available.

-a
 
Carmen:

With the upcoming NETCF release, the System.Diagnostics.Process class will
allow you to do exactly what you’re trying to achieve. More specifically,
the Process class supports "shell-execute" of known file-types (.html,
.doc, .xls, and the PPC equivalents) and regular executables. For example,
to open the file ‘sample.xls’ using Pocket Excel, you would write:
Process.Start("sample.xls", "");

For the time being, however, you’re limited to p/invoking into the native
layer and using the Win32 CreateProcess(...) call. Here’s a code snippit
for CreateProcess that launches the Solitare application without any
arguments. Of course, you will need to include the necessary p/invoke
definitions to use this method.

PROCESS_INFORMATION processInfo;

/* Launch the process CreateProcess <--> Process.Start
*/
CreateProcess(_T("\\windows\\solitare.exe"), _T(""), NULL, NULL, FALSE, 0,
NULL, NULL, NULL, &processInfo);

Nathan
 
Back
Top