Commit c6a51b4b authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

If an animation is already playing do not restart it.

Remove WM_CLOSE handler, it leads to a memory corruption later on.
parent 764ff272
...@@ -414,8 +414,8 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam) ...@@ -414,8 +414,8 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam)
return FALSE; return FALSE;
if (infoPtr->hThread || infoPtr->uTimer) { if (infoPtr->hThread || infoPtr->uTimer) {
FIXME("Already playing ? what should I do ??\n"); TRACE("Already playing\n");
ANIMATE_DoStop(infoPtr); return TRUE;
} }
infoPtr->nFromFrame = (INT)LOWORD(lParam); infoPtr->nFromFrame = (INT)LOWORD(lParam);
...@@ -443,10 +443,8 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam) ...@@ -443,10 +443,8 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam)
if(GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT) if(GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
{ {
HDC hDC = GetDC(hWnd);
infoPtr->hbrushBG = (HBRUSH)SendMessageA(infoPtr->hwndNotify, infoPtr->hbrushBG = (HBRUSH)SendMessageA(infoPtr->hwndNotify,
WM_CTLCOLORSTATIC, 0, (LPARAM)hWnd); WM_CTLCOLORSTATIC, 0, (LPARAM)hWnd);
ReleaseDC(hWnd,hDC);
} }
TRACE("Using an animation thread\n"); TRACE("Using an animation thread\n");
...@@ -804,7 +802,7 @@ static LRESULT ANIMATE_Create(HWND hWnd, WPARAM wParam, LPARAM lParam) ...@@ -804,7 +802,7 @@ static LRESULT ANIMATE_Create(HWND hWnd, WPARAM wParam, LPARAM lParam)
InitializeCriticalSection(&infoPtr->cs); InitializeCriticalSection(&infoPtr->cs);
return 0; return TRUE;
} }
...@@ -860,8 +858,10 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP ...@@ -860,8 +858,10 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
case ACM_OPENA: case ACM_OPENA:
return ANIMATE_OpenA(hWnd, wParam, lParam); return ANIMATE_OpenA(hWnd, wParam, lParam);
/* case ACM_OPEN32W: FIXME!! */ case ACM_OPENW:
/* return ANIMATE_Open32W(hWnd, wParam, lParam); */ FIXME("ACM_OPENW: stub!\n");
/* return ANIMATE_Open32W(hWnd, wParam, lParam); */
return 0;
case ACM_PLAY: case ACM_PLAY:
return ANIMATE_Play(hWnd, wParam, lParam); return ANIMATE_Play(hWnd, wParam, lParam);
...@@ -870,19 +870,16 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP ...@@ -870,19 +870,16 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
return ANIMATE_Stop(hWnd, wParam, lParam); return ANIMATE_Stop(hWnd, wParam, lParam);
case WM_NCCREATE: case WM_NCCREATE:
ANIMATE_Create(hWnd, wParam, lParam); return ANIMATE_Create(hWnd, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_NCHITTEST: case WM_NCHITTEST:
return HTTRANSPARENT; return HTTRANSPARENT;
case WM_DESTROY: case WM_DESTROY:
ANIMATE_Destroy(hWnd, wParam, lParam); return ANIMATE_Destroy(hWnd, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_ERASEBKGND: case WM_ERASEBKGND:
ANIMATE_EraseBackground(hWnd, wParam, lParam); return ANIMATE_EraseBackground(hWnd, wParam, lParam);
break;
/* case WM_STYLECHANGED: FIXME shall we do something ?? */ /* case WM_STYLECHANGED: FIXME shall we do something ?? */
...@@ -896,10 +893,6 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP ...@@ -896,10 +893,6 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
} }
return ANIMATE_DrawFrame(ANIMATE_GetInfoPtr(hWnd)); return ANIMATE_DrawFrame(ANIMATE_GetInfoPtr(hWnd));
case WM_CLOSE:
ANIMATE_Free(ANIMATE_GetInfoPtr(hWnd));
return TRUE;
case WM_PAINT: case WM_PAINT:
{ {
ANIMATE_INFO* infoPtr = ANIMATE_GetInfoPtr(hWnd); ANIMATE_INFO* infoPtr = ANIMATE_GetInfoPtr(hWnd);
...@@ -940,8 +933,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP ...@@ -940,8 +933,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
break; break;
case WM_SIZE: case WM_SIZE:
ANIMATE_Size(hWnd, wParam, lParam); return ANIMATE_Size(hWnd, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP))
......
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