在程序中任何地方调用Application.Terminate
都会使程序结束。
winexec
是打开其它程序用的。
如WinExec('C:/WINDOWS/NOTEPAD.EXE C:/My Documents/my.txt',SW_SHOWNORMAL);
不过还不与用ShellExecute
shellexecute(handle,nil,pchar('C:/My Documents/my.txt'),nil,nil,sw_shownormal);
ShellExecute(
HWND hwnd, // handle to parent window
LPCTSTR lpOperation, // pointer to string that specifies operation to perform
LPCTSTR lpFile, // pointer to filename or folder name string
LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters
LPCTSTR lpDirectory, // pointer to string that specifies default directory
INT nShowCmd // whether file is shown when opened
);