>>想在其中调用windows的程序:比如调用windows的查找程<br>序,怎么实现?<br><br>Way1:<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> hExeHandle : THandle;<br>begin<br> hExeHandle := WinExec('arj.exe /?',<br> SW_SHOWNORMAL);<br>end;<br><br><br>Way2:<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> sCommandLine: string;<br> bCreateProcess: boolean;<br> lpStartupInfo: TStartupInfo;<br> lpProcessInformation: TProcessInformation;<br>begin<br> sCommandLine := 'D:/TEMP/TEST.EXE';<br> FillChar(lpStartupInfo, Sizeof(TStartupInfo), #0);<br> lpStartupInfo.cb := Sizeof(TStartupInfo);<br> lpStartupInfo.dwFlags := STARTF_USESHOWWINDOW;<br> lpStartupInfo.wShowWindow := SW_NORMAL;<br><br> bCreateProcess := CreateProcess(nil, PChar(sCommandLine),<br> nil, nil, True, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,<br> nil, nil, lpStartupInfo, lpProcessInformation);<br>end; | <br> |<br> LPCTSTR (C),工作目录