[fpc-devel] TProcess.Terminate

Michael Van Canneyt michael at freepascal.org
Fri Oct 5 09:39:44 CEST 2007



On Fri, 5 Oct 2007, Micha Nelissen wrote:

> 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.

Sure, this is an implementation detail. 0 and -1 can be special values.

Michael.



More information about the fpc-devel mailing list