Hello jamie,
thank you for your answers.
If I read the VB code correctly then the application, that is calling an other application, is frozen until the called process is terminated.
This is not what I need, my application must be controllable while the other app is running.
I think I have to explain more details.
I am programming a little tool for a security application called VulnDetect (the upcoming replacement for Secunia PSI, the Personal Software Inspector).
VulnDetect scans your computer for installed applications and tells you when you have applications that have known vulnerabilities.
So users are encouraged to install the latest version without the vulnerabilities.
VulnDetect scans the PC automatically once per day, there is no GUI.
So users can start the manual scan only via a command and this process must be run in administrator mode.
Otherwise some information can not be gathered.
So I coded a little tool for users so they can start the scan with a single mouse click.
But I offer some other features (this is the reason why my tool
needs to be controllable while the scan is running).
First I used the
TProcess control and here everything seemed to be perfect:
I started the scan (the process) and disabled the "Scan" button, so users can not start a second scan (but use all other buttons and controls).
I also used a timer with the interval 1 second to check if the process is still running:
if prcFullScan.Running = false then begin
// Process no more running, so here is some code like enable the buttons, stop the timer and play a beep sound
end;
The only problem is that the
process was started without Administrator rights.
So the
perfect solution would be to
start the scan with the TProcess with Administrator rights.
Is that possible?
I did not find a way so I used the
RunAsAdmin function that is found here:
http://wiki.freepascal.org/Executing_External_Programs#Using_ShellExecuteEx_for_elevation.2Fadministrator_permissionsSo the scan process is running in administrator mode but now I need a way to check if the process is still running.
And my application must be controllable while the process is running.
Thank you for your help!
Best regards
OLLI