ProcessTermination Event

Fires when a process is being terminated.

Syntax

// CBProcessProcessTerminationEventArgs carries the CBProcess ProcessTermination event's parameters.
type CBProcessProcessTerminationEventArgs struct {...}

func (args *CBProcessProcessTerminationEventArgs) ProcessId() int32
func (args *CBProcessProcessTerminationEventArgs) ProcessName() string
func (args *CBProcessProcessTerminationEventArgs) ResultCode() int32
func (args *CBProcessProcessTerminationEventArgs) SetResultCode(value int32)

// CBProcessProcessTerminationEvent defines the signature of the CBProcess ProcessTermination event's handler function.
type CBProcessProcessTerminationEvent func(sender *CBProcess, args *CBProcessProcessTerminationEventArgs)

func (obj *CBProcess) GetOnProcessTerminationHandler() CBProcessProcessTerminationEvent
func (obj *CBProcess) SetOnProcessTerminationHandler(handlerFunc CBProcessProcessTerminationEvent)

Remarks

This event fires when a process is being terminated, just before its last thread is destroyed.

Applications cannot prevent a process from being terminated using this event; use the ProcessHandleOperation event instead.

The ProcessId parameter reflects the Id of the terminating process.

The ProcessName parameter reflects the name of the terminating process. This parameter's value is the same one that the GetProcessName method would return for ProcessId.

The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a non-zero value to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.

Note that the system APIs offer no way to report errors which occur during the processing of this request. Exceptional ResultCode values are therefore largely ignored.

This event is fired synchronously; please refer to the Event Types topic for more information.

Copyright (c) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS Filter 2020 Go Edition - Version 20.0 [Build 8317]