gpt4 book ai didi

delphi - 如何在 Mac 上的 Lazarus 中执行与 shellexecute() 等效的操作?

转载 作者:行者123 更新时间:2023-12-03 14:51:01 31 4
gpt4 key购买 nike

如何在 Mac 版 Lazarus 中执行与 shellexecute() 等效的操作?

最佳答案

{ 这是执行此操作的代码。使用 TProcess 对象! }

uses Process;

...

procedure DoProcess;
Var
Proc : TProcess;

Begin
Proc := TProcess.Create(nil);
try
Proc.CommandLine := '/Applications/MyApp.app';

PRoc.Options := Proc.Options + [poWaitOnExit];
Proc.CommandLine := Proc.CommandLine + ' -someparam';
PRoc.Execute;
finally
Proc.free;
end;
End;

关于delphi - 如何在 Mac 上的 Lazarus 中执行与 shellexecute() 等效的操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/591678/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com