/// <summary>Creates a timer with the specified time-out value and coalescing tolerance delay.</summary>
/// <param name="hWnd"><para>Type: <c>HWND</c></para><para>A handle to the window to be associated with the timer. This window must be owned by the calling thread. If a <c>NULL</c> value for hWnd is passed in along with an nIDEvent of an existing timer, that timer will be replaced in the same way that an existing non-NULL hWnd timer will be.</para></param>
/// <param name="nIDEvent"><para>Type: <c>UINT_PTR</c></para><para>A timer identifier. If the hWnd parameter is <c>NULL</c>, and the nIDEvent does not match an existing timer, then the nIDEvent is ignored and a new timer ID is generated. If the hWnd parameter is not <c>NULL</c> and the window specified by hWnd already has a timer with the value nIDEvent, then the existing timer is replaced by the new timer. When <c>SetCoalescableTimer</c> replaces a timer, the timer is reset. Therefore, a message will be sent after the current time-out value elapses, but the previously set time-out value is ignored. If the call is not intended to replace an existing timer, nIDEvent should be 0 if the hWnd is <c>NULL</c>.</para></param>
/// <param name="uElapse"><para>Type: <c>UINT</c></para><para>The time-out value, in milliseconds.</para><para>If uElapse is less than <c>USER_TIMER_MINIMUM</c> (0x0000000A), the timeout is set to <c>USER_TIMER_MINIMUM</c>. If uElapse is greater than <c>USER_TIMER_MAXIMUM</c> (0x7FFFFFFF), the timeout is set to <c>USER_TIMER_MAXIMUM</c>.</para><para>If the sum of uElapse and uToleranceDelay exceeds <c>USER_TIMER_MAXIMUM</c>, an ERROR_INVALID_PARAMETER exception occurs.</para></param>
/// <param name="lpTimerFunc"><para>Type: <c>TIMERPROC</c></para><para>A pointer to the function to be notified when the time-out value elapses. For more information about the function, see TimerProc. If lpTimerFunc is <c>NULL</c>, the system posts a WM_TIMER message to the application queue. The <c>hwnd</c> member of the message's MSG structure contains the value of the hWnd parameter.</para></param>
/// <param name="uToleranceDelay"><para>Type: <c>ULONG</c></para><para>It can be one of the following values:</para><list type="table"><listheader><term>Value</term><term>Meaning</term></listheader><item><term> TIMERV_DEFAULT_COALESCING 0x00000000 </term><term>Uses the system default timer coalescing.</term></item><item><term> TIMERV_NO_COALESCING 0xFFFFFFFF </term><term> Uses no timer coalescing. When this value is used, the created timer is not coalesced, no matter what the system default timer coalescing is or the application compatiblity flags are. </term></item><item><term> 0x1 - 0x7FFFFFF5 </term><term> Specifies the coalescing tolerance delay, in milliseconds. Applications should set this value to the system default (TIMERV_DEFAULT_COALESCING) or the largest value possible. If the sum of uElapse and uToleranceDelay exceeds USER_TIMER_MAXIMUM (0x7FFFFFFF), an ERROR_INVALID_PARAMETER exception occurs. See Windows Timer Coalescing for more details and best practices.</term></item><item><term> Any other value </term><term> An invalid value. If uToleranceDelay is set to an invalid value, the function fails and returns zero. </term></item></list></param>
/// <returns>
/// <para>Type: <c>Type: <c>UINT_PTR</c> </c></para><para>If the function succeeds and the hWnd parameter is <c>NULL</c>, the return value is an integer identifying the new timer. An application can pass this value to the KillTimer function to destroy the timer.</para><para>If the function succeeds and the hWnd parameter is not <c>NULL</c>, then the return value is a nonzero integer. An application can pass the value of the nIDEvent parameter to the KillTimer function to destroy the timer.</para><para>If the function fails to create a timer, the return value is zero. To get extended error information, call GetLastError.</para>
/// </returns>
/// <remarks>
/// <para>An application can process WM_TIMER messages by including a <c>WM_TIMER</c> case statement in the window procedure or by specifying a TimerProc callback function when creating the timer. When you specify a <c>TimerProc</c> callback function, the default window procedure calls the callback function when it processes <c>WM_TIMER</c>. Therefore, you need to dispatch messages in the calling thread, even when you use <c>TimerProc</c> instead of processing <c>WM_TIMER</c>.</para><para>The wParam parameter of the WM_TIMER message contains the value of the nIDEvent parameter.</para><para>The timer identifier, nIDEvent, is specific to the associated window. Another window can have its own timer which has the same identifier as a timer owned by another window. The timers are distinct.</para><para>SetTimer can reuse timer IDs in the case where hWnd is <c>NULL</c>.</para><para>When uToleranceDelay is set to 0, the system default timer coalescing is used and <c>SetCoalescableTimer</c> behaves the same as SetTimer.</para>