BoxedAppSDK_EnableHook

Description

The function activates or deactivates a previously created hook.

If a hook was created with bEnable = FALSE in BoxedAppSDK_HookFunction, it exists but remains inactive until explicitly enabled with this function.

You can use BoxedAppSDK_EnableHook to both enable and disable hooks at runtime. This provides flexible control over function interception without removing the hook completely.

For more information about hook usage, see Intercepting Functions.

Syntax

BOOL __stdcall BoxedAppSDK_EnableHook(HANDLE hHook, BOOL bEnable);
function BoxedAppSDK_EnableHook(hHook: THandle; bEnable: BOOL): BOOL; stdcall;

Parameters

hHook
Handle of the hook returned by BoxedAppSDK_HookFunction.

bEnable
If TRUE, activates the hook.
If FALSE, deactivates the hook but keeps it registered, allowing later reactivation.

Remarks

Deactivating a hook temporarily restores the original function behavior without removing the hook structure. Re-enabling it reinstates interception of the target function immediately.

This function is useful when you need to toggle hooks dynamically based on application state or debugging mode.

See Also