IUIAnimationManager::Update method (uianimation.h)

Updates the values of all animation variables.

Syntax

HRESULT Update(
  [in]            UI_ANIMATION_SECONDS       timeNow,
  [out, optional] UI_ANIMATION_UPDATE_RESULT *updateResult
);

Parameters

[in] timeNow

The current system time. This parameter must be greater than or equal to 0.0.

[out, optional] updateResult

The result of the update. This parameter can be omitted from calls to this method.

Return value

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. See Windows Animation Error Codes for a list of error codes.

Remarks

Calling this method advances the animation manager to timeNow, changing statuses of storyboards as necessary and updating any animation variables to appropriate interpolated values. If the animation manager is paused, no storyboards or variables are updated. If the animation mode is UI_ANIMATION_MODE_DISABLED, all scheduled storyboards finish playing immediately. If the values of any variables change during this call, the value of updateResult is UI_ANIMATION_UPDATE_VARIABLES_CHANGED; otherwise, it is UI_ANIMATION_UPDATE_NO_CHANGE.

Examples

The following example updates the animation manager with the current time. For additional examples, see Update the Animation Manager and Draw Frames.

// Update the animation manager with the current time
UI_ANIMATION_SECONDS secondsNow;
hr = m_pAnimationTimer->GetTime(
    &secondsNow
    );
if (SUCCEEDED(hr))
{
    UI_ANIMATION_UPDATE_RESULT updateResult;
    hr = m_pAnimationManager->Update(
        secondsNow,
        &updateResult
        );
    if (SUCCEEDED(hr))
    {
        if (updateResult == UI_ANIMATION_UPDATE_VARIABLES_CHANGED)
        {
            ...
        }
    }
}

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server None supported
Target Platform Windows
Header uianimation.h
DLL UIAnimation.dll

See also

IUIAnimationManager

IUIAnimationManager::Pause

IUIAnimationManager::Resume

IUIAnimationManager::SetAnimationMode

UI_ANIMATION_MODE

UI_ANIMATION_UPDATE_RESULT