ToggleProcessProtection Method

Enables or disables termination protection for the application.

Syntax

public bool ToggleProcessProtection(bool enabled);
Public Function ToggleProcessProtection(ByVal Enabled As Boolean) As Boolean

Remarks

This method controls the termination protection mechanism, which applications can enable to prevent their process and threads from being terminated. If successful, this method returns true; otherwise, it returns false.

The Enabled parameter specifies whether termination protection should be enabled (true) or disabled (false); it is disabled by default. If termination protection is enabled, an application must disable it before attempting to exit.

Important: When developing a GUI-based application, please keep in mind that the termination protection mechanism does not intercept window notifications like WM_CLOSE, WM_QUIT, etc.; applications must intercept and handle such messages themselves if they wish to protect their UI. Please refer to Microsoft's Window Notifications articles for more information.

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