Note: Do not make Presentation Manager calls from exception handlers.
DosRaiseException enables a thread to raise a synchronous exception that has been deferred from a must-complete section. DosRaiseException can also be used to simulate an asynchronous or synchronous exception.
For a detailed list of the system exceptions, see System Exceptions.