This function maintains a show count. When a hide request is made, this count is decremented; when a show request is made, the count is incremented. When the count makes a transition from 0 to -1, the rectangle is hidden; when the count makes a transition from -1 to 0, the rectangle is shown.
When a rectangle is tracking, the application must call this function to hide the rectangle if there is a possibility of corrupting the tracking rectangle while drawing. The rectangle is shown afterwards. Because the structure is updated continuously, the application can examine the coordinates of the current tracking rectangle to determine whether temporary hiding is necessary.
The only case where an application needs to use this function is during asynchronous drawing. If an application is drawing on one thread, and issuing WinTrackRect on another, unwanted areas of tracking rectangle may be left behind. The drawing thread is therefore responsible for calling this function whenever tracking is in progress. The application must provide for communication between the two threads to ensure that if one thread is tracking, the drawing thread issues this function. This can be done with a semaphore.