Forum > General

Set Program in background - How ?


I want to make program that starts external exe and kill's it after some time
this is code
program start_kill;

   Classes, SysUtils, Process;

   AProcess: TProcess;
   BProcess: TProcess;

{$IFDEF WINDOWS}{$R shakeme_gotovo.rc}{$ENDIF}

   AProcess := TProcess.Create(nil);
   AProcess.CommandLine := 'C:\WINDOWS\System32\dxdiag.exe';
   AProcess.Options := AProcess.Options;
   while AProcess.Running do
   BProcess := TProcess.Create(nil);
   BProcess.Commandline := 'C:\Windows\system32\tskill.exe dxdiag';
   BProcess.Options := BProcess.Options;

Now i dont want it to popup/take fokus but only to start and kill proces without notifications
How to set program in background ?

Best regards to all  ;D

I think you can't. I think that the program itself that you want to start must be executed in background mode. If you want that the program mustn't displayed on the desktop you must run the main program like a service.

You can use TSimpleICPClient and TSimpleIPCServer (under system tab)
You can send and recieve mesages between two local applications using these two components


[0] Message Index

Go to full version