Commit 1030d412 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

comctl32: Support seeking to a particular frame.

In this case just draw the frame without starting the timer thread of setting a timer and without sending any notifications.
parent 92dde895
......@@ -145,6 +145,8 @@ static BOOL ANIMATE_LoadFileW(ANIMATE_INFO *infoPtr, LPWSTR lpName)
static BOOL ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
{
BOOL stopped = FALSE;
EnterCriticalSection(&infoPtr->cs);
/* should stop playing */
......@@ -167,14 +169,17 @@ static BOOL ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
CloseHandle( handle );
CloseHandle( infoPtr->hStopEvent );
infoPtr->hStopEvent = 0;
stopped = TRUE;
}
if (infoPtr->uTimer) {
KillTimer(infoPtr->hwndSelf, infoPtr->uTimer);
infoPtr->uTimer = 0;
stopped = TRUE;
}
LeaveCriticalSection(&infoPtr->cs);
if (stopped)
ANIMATE_Notify(infoPtr, ACN_STOP);
return TRUE;
......@@ -429,12 +434,20 @@ static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WOR
TRACE("(repeat=%d from=%d to=%d);\n",
infoPtr->nLoop, infoPtr->nFromFrame, infoPtr->nToFrame);
if (infoPtr->nFromFrame >= infoPtr->nToFrame ||
if (infoPtr->nFromFrame > infoPtr->nToFrame ||
infoPtr->nToFrame >= infoPtr->mah.dwTotalFrames)
return FALSE;
infoPtr->currFrame = infoPtr->nFromFrame;
/* seek - doesn't need to start a thread or set a timer and neither
* does it send a notification */
if (infoPtr->nFromFrame == infoPtr->nToFrame)
{
ANIMATE_DrawFrame(infoPtr);
return TRUE;
}
if (infoPtr->dwStyle & ACS_TIMER)
{
TRACE("Using a timer\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment