[fpc-devel] TProcess.Terminate

Micha Nelissen micha at neli.hopto.org
Fri Oct 5 09:39:38 CEST 2007


Michael Van Canneyt wrote:
> What concerns a WM_QUIT: you need a window handle for this, and you
> don't have that in e.g. a command-line program or service.

Perhaps there is a way to query the "main window" for a process, if any ?

> If you want a more 'friendly' way, I think we should add a call
> 'TryTerminate(Timeout : Integer)' or something, which tries to 
> send a WM_QUIT on windows and which sends a TERM on Linux; after 
> TimeOut milliseconds it should probe to see whether the process
> actually stopped.

Probably you want the call to return as soon as possible, not always 
after Timeout ? Also, there should be async way, perhaps when Timeout = 0.

Micha



More information about the fpc-devel mailing list