//声明WinExec( lpCmdLine: LPCSTR; {文件名和参数; 如没指定路径会按以下顺序查找: 程序目录/当前目录/System32/Windows/PATH环境变量} uCmdShow: UINT {启动选项}): UINT;//返回值:大于 31 {调用成功}等于 0 {内存不足}ERROR_FILE_NOT_FOUND = 2; {文件名错误}ERROR_PATH_NOT_FOUND = 3; {路径名错误}ERROR_BAD_FORMAT = 11; {EXE 文件无效}//uCmdShow 参数可选值:SW_HIDE = 0; {隐藏, 并且任务栏也没有最小化图标}SW_SHOWNORMAL = 1; {用最近的大小和位置显示, 激活}SW_NORMAL = 1; {同 SW_SHOWNORMAL}SW_SHOWMINIMIZED = 2; {最小化, 激活}SW_SHOWMAXIMIZED = 3; {最大化, 激活}SW_MAXIMIZE = 3; {同 SW_SHOWMAXIMIZED}SW_SHOWNOACTIVATE = 4; {用最近的大小和位置显示, 不激活}SW_SHOW = 5; {同 SW_SHOWNORMAL}SW_MINIMIZE = 6; {最小化, 不激活}SW_SHOWMINNOACTIVE = 7; {同 SW_MINIMIZE}SW_SHOWNA = 8; {同 SW_SHOWNOACTIVATE}SW_RESTORE = 9; {同 SW_SHOWNORMAL}SW_SHOWDEFAULT = 10; {同 SW_SHOWNORMAL}SW_MAX = 10; {同 SW_SHOWNORMAL} from
//举例, 启动记事本:procedure TForm1.Button1Click(Sender: TObject);begin WinExec('notepad.exe', SW_SHOWNORMAL);end;