Ver Mensaje Individual
  #4  
Antiguo 04-06-2006
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Bueno, según la ayuda de Delphi el procedimiento "Halt":

Cita:
Empezado por Ayuda de Delphi
Initiates abnormal termination of a program.

Description

Halt performs an abnormal termination of a program and returns to the operating system.

To perform a normal termination of a Delphi application, call the Terminate method on the global Application object. If the application does not use a unit that provides an Application object, call the Exit procedure from the main Program block.

Exitcode is an optional expression that specifies an exit code for the program.
O sea, puedes valerte de "Application.Terminate" Aunque, si como dice el compañero utilizas el método "Close" del formulario principal de tu aplicación:

Código Delphi [-]
procedure TCustomForm.Close;
var
  CloseAction: TCloseAction;
begin
  if fsModal in FFormState then
    ModalResult := mrCancel
  else
    if CloseQuery then
    begin
      if FormStyle = fsMDIChild then
        if biMinimize in BorderIcons then
          CloseAction := caMinimize else
          CloseAction := caNone
      else
        CloseAction := caHide;
      DoClose(CloseAction);
      if CloseAction <> caNone then
        if Application.MainForm = Self then Application.Terminate
        else if CloseAction = caHide then Hide
        else if CloseAction = caMinimize then WindowState := wsMinimized
        else Release;
    end;
end;

Y, por otro lado, si utilizas el método "Close" sabes que podrás aprovechar los eventos "OnClose" y "OnCloseQuery" del formulario en cuestión, si eso te sirve de algo.
__________________
David Esperalta
www.decsoftutils.com
Responder Con Cita