I've done a lot of searching, but have not found any examples using the Windows IApplicationActivationManager
in Delphi. The interface does not appear to be defined in my Delphi 10.4.2 Community Edition. I need to load Windows AppStore application and wait for them to terminate.
Has anybody used this interface in Delphi, and can provide an example of how to define and use it?
I've found the following on this site using C#, but have been unsuccessful in coming up with a working Delphi equivalent:
IApplicationActivationManager::ActivateApplication in C#?
I have tried using CreateProcess
, ShellExecute
, explorer.exe
, etc invocations with Windows AppStore application (packaged apps with AUMID), but nothing works as needed. Traditional apps work fine. Invoking a process via CreateProcess
, ShellExecute
, explorer.exe
etc all terminate and return to my application before the invoked application itself terminates. I need my application to wait until the invoked application itself terminates.
In my application, I need to:
- perform some configurable action (eg: extract a file from a Zip file, decrypt a file, etc).
- run a configurable application appropriate to the resulting file in step 1 (eg: edit the file).
- perform a mirror/undo action to the action in step 1 (eg: add updated file back into the Zip file, re-encrypt the file, etc).
The IApplicationActivationManager
interface appears to do what I need for my application, as it returns a ProcessID, presumably for the application that it started. I can then monitor that ProcessID and wait for the application to terminate.