其中 ShellExecute 要 use ShellAPI,
WinExec 則是 Windows.
其語法如下:
ShellExecute 要傳入 (0,'OPEN', 指令, 參數, nil, 方式)
WinExec 則只要傳入 ( 指令(含參數), 方式)
即可
代碼: 選擇全部
ShellExecute(0, PChar('OPEN'), 'ping.exe', '127.0.0.1 -t', nil, SW_SHOWNA);
WinExec( PChar('ping.exe 127.0.0.1 -t'), SW_SHOWNA);