这是函数说明: HINSTANCE 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 ); 这是调用例子: ShellExecute(handle, "open", path_to_folder, NULL, NULL, SW_SHOWNORMAL); 现在你应该知道能不能了吧
HINSTANCE 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
);
这是调用例子:
ShellExecute(handle, "open", path_to_folder, NULL, NULL, SW_SHOWNORMAL);
现在你应该知道能不能了吧
ShellExecute(handle,'open',PChar'c:\kdt\kdt.exe'),nil,nil,SW_SHOW);
ShellExecute(handle,'open',PChar'c:\zjm.txt'),nil,nil,SW_SHOW);
winexec('c:\kdt\kdt.exe c:\zjm.txt',sw_show)的写法是正确,
如:winexec('c:\windows\notepad.exe c:\zjm.txt',sw_show)可以用记事本找开c:\zjm.txt
2.ShellExecute(handle,'open',PChar('c:\kdt\kdt.exe'),PChar('c:\zjm.txt'),nil,SW_SHOW);