UI thread use the events that are created with CreateEvent API. These events (their handles) are known for the UI thread and the worker thread. UI thread raises the events by calling SetEvent. The working thread is always in a waiting mode - it contains a loop with WaitForMultipleObject inside - this function allows to wait for few events and if one these events gets the signaled state, this thread can perform an action.
If the working thread need to notify the UI thread, it sends a message to the main window of this thread.