我怎样才能做到这一点?
出于某种原因或由用户选择,“要求”当前应用程序自行重新启动。
最佳答案
uses ShellAPI;
...
procedure TForm1.RestartThisApp;
begin
ShellExecute(Handle, nil, PChar(Application.ExeName), nil, nil, SW_SHOWNORMAL);
Application.Terminate; // or, if this is the main form, simply Close;
end;
关于delphi - 关闭并重新启动DELPHI中的当前应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6020867/