# RegisterCancelCallback(int, Func<bool>)

> Registers a callback that is called when the user requests to cancel a running progress indicator's associated task.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static void RegisterCancelCallback(int id, Func<bool> callback)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The progress indicator's unique ID.**** (\[Func\<bool>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): The function called when a request to cancel a progress indicator's associated task is made. The function returns true if it actually cancelled the task.

### Remarks

Additional Resources: [Progress.Cancel](/engine/6000.7/script-reference/unityeditor/progress/cancel.md), [Progress.UnregisterCancelCallback](/engine/6000.7/script-reference/unityeditor/progress/unregistercancelcallback.md).
