Refer to the API CopyFileEx where you can specify your call back function in the third parameter and you will see how the call back function of yours is called