TerminateApp

3.1

  #include <toolhelp.h>    

  void TerminateApp(htask, wFlags)    
  HTASK htask; /* handle of task, */  
  WORD wFlags; /* termination flags, */  

The TerminateApp function ends the given application instance (task).

Parameters

htask

Identifies the task to be ended. If this parameter is NULL, it identifies the current task.

wFlags

Indicates how to end the task. This parameter can be one of the following values:

Value Meaning

UAE_BOX Calls the Windows kernel to display the Application Error message box and then ends the task.
NO_UAE_BOX Calls the Windows kernel to end the task but does not display the Application Error message box. The application's interrupt or notification callback function should have displayed an error message, a warning, or both.

Return Value

This function returns only if htask is not NULL and does not identify the current task.

Comments

The TerminateApp function unregisters all callback functions registered with the Tool Help functions and then ends the application as if the given task had produced a general-protection (GP) fault or other error.

TerminateApp should be used only by debugging applications, because the function may not free not all objects owned by the ended application.

See Also

InterruptRegister, InterruptUnRegister, NotifyRegister, NotifyUnRegister