This method of the IUserEventTimer interface


GetUserEventTimerElapsed (
    HWND hWnd,
    ULONG uUserEventTimerID,
    UINT *puTimerElapsed);


The hWnd and uUserEventTimerID arguments identify the timer.

The puTimerElapsed argument provides the address of a variable that is to receive the number of milliseconds of user-active time that have elapsed since the last timeout (or since the timer was set).

Return Value

The function returns zero for success, else an error code.


If puTimerElapsed is NULL, no means exists to return the desired information, and the function fails. If uUserEventTimerID is zero, then no timer is identified, and the function fails. If the internal timer is not yet initialised (which should not ordinarily be possible by the time this interface method can be called), the function fails. In all these cases, the returned error code is E_FAIL.

If the combination of hWnd and uUserEventTimerID does not identify a timer as set already through the SetUserEventTimer method, the function fails, returning E_FAIL, but also reports the elapsed time as zero.