[Dropped] AOO task still running after Delphi program terminates
Posted: Wed Sep 15, 2021 4:48 pm
I'm writing a delphi 10.3 program and testing on Windows 10.
When I run the terminate command on a com.sun.star.frame.Desktop object, the office task remains running in the background and can be seen on the windows task manager. The following is the most simple version of the code i'm using to replicate this.
I can force the task to terminate by sunning but that seems a bit hacky...
How do I terminate the office task using the service manager or desktop?
When I run the terminate command on a com.sun.star.frame.Desktop object, the office task remains running in the background and can be seen on the windows task manager. The following is the most simple version of the code i'm using to replicate this.
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
ooServiceManager, ooDesktop: Variant;
begin
ooServiceManager := CreateOleObject('com.sun.star.ServiceManager');
ooDesktop := ooServiceManager.CreateInstance('com.sun.star.frame.Desktop');
ooDesktop.Terminate;
end;
Code: Select all
ShellExecute(0, nil, 'c:\windows\system32\taskkill.exe', '/F /iM soffice.bin', nil, SW_HIDE);
How do I terminate the office task using the service manager or desktop?