[DllImport("msvcrt.dll", CallingConvention=CallingConvention.Cdecl)]
static extern IntPtr _wspawnl(
int mode, // _P_ constant (_P_WAIT=0, _P_NOWAIT=1)
[MarshalAs(UnmanagedType.LPWStr)]string cmdname,
[MarshalAs(UnmanagedType.LPWStr)]string arg0,
[MarshalAs(UnmanagedType.LPWStr)]string arg1,
[MarshalAs(UnmanagedType.LPWStr)]string argNULL);
Declare Function _spawn Lib "msvcrt.dll" (TODO) As TODO
None.
Do you know one? Please contribute it!
None.
Please add some!
C# Sample Code
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr _wspawnl(
int mode, // _P_ constant (_P_WAIT=0, _P_NOWAIT=1)
[MarshalAs(UnmanagedType.LPWStr)]string cmdname,
[MarshalAs(UnmanagedType.LPWStr)]string arg0,
[MarshalAs(UnmanagedType.LPWStr)]string arg1,
[MarshalAs(UnmanagedType.LPWStr)]string argNULL);
static int _P_WAIT = 0; // Suspends calling thread until execution of new process
// is complete (synchronous _spawn).
static int _P_NOWAIT = 1; // Continues to execute calling process concurrently with
// new process (asynchronous _spawn).
static int _P_OVERLAY = 2; // Overlays calling process with new process, destroying
// the calling process (same effect as _exec calls).
static int _P_NOWAITO = 3; // Continues to execute calling process concurrently with
// new process (asynchronous _spawn).
static int _P_DETACH = 4; // Continues to execute the calling process; new process
// is run in the background with no access to the console
// or keyboard. Calls to _cwait against the new process will
// fail (asynchronous _spawn).
// start process AppName and destroy the current process
_wspawnl(_P_OVERLAY, AppName, "", "", null);