The function creates a new thread, which executes within the same address space as the calling process. The thread entry point is specified with the fun argument.
The function selects which function to be called upon a window refresh event, which occurs when any part of the window client area has been damaged, and needs to be repainted (for instance, if a part of the window that was previously occluded by another window has become visible).