ShellexecuteInfo shexecinfo = {0};
Shexecinfo.cbsize = sizeof (shellexecuteInfo);
Shexecinfo.fmask = see_mask_nocloseprocess;
Shexecinfo.hwnd = null;
Shexecinfo.lpverb = null;
Shexecinfo.lpfile = "c: //myprogram.exe";
Shexecinfo.lpparameters = ""
ShexecInfo.lpdirectory = null;
Shexecinfo.nshow = sw_show;
Shexecinfo.hinstapp = null;
ShellexecuteEx (& shexecInfo);
WaitforsingleObject (ShexecInfo.hprocess, Infinite);
Or: Process_information Processinfo;
StartupInfo Startupinfo; // this is an [in] parameter
ZeromeMory (& StartupInfo, Sizeof (StartupInfo);
Startupinfo.cb = sizeof startupinfo; // Only compulsory field
IF (CreateProcess ("C: //winnt//notepad.exe", null,
NULL, NULL, FALSE, 0, NULL,
NULL, & Startupinfo, & ProcessInfo)
{
WaitforsingleObject (ProcessInfo.hprocess, Infinite);
CloseHandle (ProcessInfo.hthread);
CloseHandle (ProcessInfo.hprocess);
}
Else
{
MessageBox ("The Process Could Not Be Started ...");
}