Three SDK functions winexec, shellexecute,createprocess can be used.
WinExec The simplest, two parameters, the previous specified path, and the latter specifies the display mode. The latter argument is worth saying
, such as mud with sw_showmaxmized way to add a program without maximizing the button, hehe is
Neterm,calc and so on, there will be no normal form, but it has been added to the task list.
ShellExecute more flexible than Winexex, you can specify the working directory, the following example is directly open
C:/temp/1.txt, instead of adding an application associated with a TXT file, many installers will open after completion
A window to display the Readme or FAQ, I guess this is the way to do it.
ShellExecute (null,null,_t ("1.txt"), null,_t ("C://temp"), sw_showmaxmized);
CreateProcess is the most complex, a total of 10 parameters, but most of them can be replaced with NULL, it can specify
The security properties of the process, the inheritance information, the class priority, and so on. Let's look at a very simple Example:
Startupinfo Stinfo; Information about the Startup window
ProcessInfo ProcInfo; Information about the process
CreateProcess (null,_t ("notepad.exe"), Null,null. FALSE, Normal_priority_
Class,null,null, &stinfo,&procinfo);
Go MFC Loads other applications