Huw Davies : comctl32: Get the background brush in ACM_OPEN where native does.

Alexandre Julliard julliard at winehq.org
Tue Mar 11 10:51:53 CDT 2008


Module: wine
Branch: master
Commit: 84a1a88c5a973b9cd7b6fad7cb0fca3e26f78a9a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=84a1a88c5a973b9cd7b6fad7cb0fca3e26f78a9a

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Mar 11 14:12:51 2008 +0000

comctl32: Get the background brush in ACM_OPEN where native does.

---

 dlls/comctl32/animate.c |   25 ++++++++-----------------
 1 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c
index 057cc3e..262bd7f 100644
--- a/dlls/comctl32/animate.c
+++ b/dlls/comctl32/animate.c
@@ -379,10 +379,6 @@ static LRESULT ANIMATE_Timer(ANIMATE_INFO *infoPtr)
 
     if ((hDC = GetDC(infoPtr->hwndSelf)) != 0)
     {
-        if (infoPtr->dwStyle & ACS_TRANSPARENT)
-            infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
-                                                     WM_CTLCOLORSTATIC,
-                                                     (WPARAM)hDC, (LPARAM)infoPtr->hwndSelf);
         EnterCriticalSection(&infoPtr->cs);
         ANIMATE_DrawFrame(infoPtr, hDC);
         LeaveCriticalSection(&infoPtr->cs);
@@ -403,10 +399,6 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
     {
         HDC hDC = GetDC(infoPtr->hwndSelf);
 
-        if (infoPtr->dwStyle & ACS_TRANSPARENT)
-            infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
-                                                     WM_CTLCOLORSTATIC,
-                                                     (WPARAM)hDC, (LPARAM)infoPtr->hwndSelf);
         EnterCriticalSection(&infoPtr->cs);
         ANIMATE_DrawFrame(infoPtr, hDC);
         timeout = infoPtr->mah.dwMicroSecPerFrame;
@@ -461,10 +453,6 @@ static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WOR
 
         if ((hDC = GetDC(infoPtr->hwndSelf)) != 0)
         {
-            if (infoPtr->dwStyle & ACS_TRANSPARENT)
-                infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
-                                                         WM_CTLCOLORSTATIC,
-                                                         (WPARAM)hDC, (LPARAM)infoPtr->hwndSelf);
             ANIMATE_DrawFrame(infoPtr, hDC);
 
 	    ReleaseDC(infoPtr->hwndSelf, hDC);
@@ -481,11 +469,6 @@ static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WOR
     } 
     else 
     {
-        if(infoPtr->dwStyle & ACS_TRANSPARENT)
-            infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
-                                                     WM_CTLCOLORSTATIC, 0,
-                                                     (LPARAM)infoPtr->hwndSelf);
-
 	TRACE("Using an animation thread\n");
         infoPtr->hStopEvent = CreateEventW( NULL, TRUE, FALSE, NULL );
         infoPtr->hThread = CreateThread(0, 0, ANIMATE_AnimationThread,
@@ -718,6 +701,8 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
 
 static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lpszName)
 {
+    HDC hdc;
+
     ANIMATE_Free(infoPtr);
 
     if (!lpszName) 
@@ -767,6 +752,12 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps
 	return FALSE;
     }
 
+    hdc = GetDC(infoPtr->hwndSelf);
+    /* native looks at the top left pixel of the first frame here too. */
+    infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC,
+                                             (WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
+    ReleaseDC(infoPtr->hwndSelf, hdc);
+
     if (!(infoPtr->dwStyle & ACS_CENTER))
 	SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, infoPtr->mah.dwWidth, infoPtr->mah.dwHeight,
 		     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);




More information about the wine-cvs mailing list