Determine if the current asynchronous task has completed.
This method returns a boolean value. If the task has finished, the return value is true. If the background task is still active, the return value is false.
The TaskDone method is used to determine if the current asynchronous task has completed. This overloaded version of the method is functionally equivalent to providing the value of the TaskId property as the unique task identifier.
If you use this method to poll the status of a background task from within the main UI thread, you must ensure that Windows messages are processed so that the application remains responsive to the end-user. To check if a background transfer has completed, it is recommended that you use a timer to periodically call this method rather than calling it repeatedly within a loop.
To determine if the task completed successfully, the TaskWait method will provide the last error code associated with the task. Note that if this method returns true, it is guaranteed that calling TaskWait using the same task ID will return the error code to the caller immediately without causing the current thread to block.