一个十分困惑的问题.
我想在我的一个程序里运行其他程序该怎么做?比如在程序中想打开EDIT.exe这个程序(让它运行起来),可以用些什么方法? 问题点数:100、回复次数:7Top
1 楼rtdb(东临碣石)回复于 2003-02-04 16:42:01 得分 15
WINDOWS: Winexec(), CreateProcess()
DOS/UNIX: system()Top
2 楼oustar(欧文)回复于 2003-02-04 16:47:52 得分 15
The CreateProcess function creates a new process and its primary thread. The new process executes the specified executable file.
BOOL CreateProcess(
LPCTSTR lpApplicationName,
// pointer to name of executable module
LPTSTR lpCommandLine, // pointer to command line string
LPSECURITY_ATTRIBUTES lpProcessAttributes, // process security attributes
LPSECURITY_ATTRIBUTES lpThreadAttributes, // thread security attributes
BOOL bInheritHandles, // handle inheritance flag
DWORD dwCreationFlags, // creation flags
LPVOID lpEnvironment, // pointer to new environment block
LPCTSTR lpCurrentDirectory, // pointer to current directory name
LPSTARTUPINFO lpStartupInfo, // pointer to STARTUPINFO
LPPROCESS_INFORMATION lpProcessInformation // pointer to PROCESS_INFORMATION
);
form msdn !
GOOD LUCK!Top
3 楼KIKKA(海冰)回复于 2003-02-05 01:15:41 得分 0
不解~!
能说详细点吗?在TC下用C语言该怎么做?Top
4 楼acange(acan)回复于 2003-02-05 01:58:26 得分 50
简单的, 你可以这样:
#include<stdlib.h>
int main()
{
system("dir");
}Top
5 楼x2jack(捷可)回复于 2003-02-05 02:09:45 得分 10
system("命令行");Top
6 楼chenxihui2003(晨曦)回复于 2003-02-05 12:02:02 得分 5
UPTop
7 楼sea_lover(CodePlus)回复于 2003-02-05 13:33:35 得分 5
acange(acan) 的就可以!
-------------------------
【◇SeaLover◆〗
/ \
★---CSDN---☆
\ /
【○Trust Me●〗
Top




