[UXTHEME]
[reactos.git] / reactos / dll / win32 / uxtheme / draw.c
index 8280c66..17900f8 100644 (file)
@@ -56,7 +56,7 @@ HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
 
     TRACE("(%p,0x%08x\n", hwnd, dwFlags);
     res = SetPropW (hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled), 
-        (HANDLE)(dwFlags|0x80000000)); 
+                    UlongToHandle(dwFlags|0x80000000));
         /* 0x80000000 serves as a "flags set" flag */
     if (!res)
           return HRESULT_FROM_WIN32(GetLastError());
@@ -74,8 +74,7 @@ BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd)
     DWORD dwDialogTextureFlags;
     TRACE("(%p)\n", hwnd);
 
-    dwDialogTextureFlags = (DWORD)GetPropW (hwnd, 
-        (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled));
+    dwDialogTextureFlags = HandleToUlong( GetPropW( hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled) ));
     if (dwDialogTextureFlags == 0) 
         /* Means EnableThemeDialogTexture wasn't called for this dialog */
         return TRUE;
@@ -100,7 +99,7 @@ HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
         hParent = hwnd;
     if(prc) {
         CopyRect(&rt, prc);
-        MapWindowPoints(hwnd, NULL, (LPPOINT)&rt, 2);
+        MapWindowPoints(hwnd, hParent, (LPPOINT)&rt, 2);
         
         clip = CreateRectRgn(0,0,1,1);
         hasClip = GetClipRgn(hdc, clip);
@@ -110,8 +109,8 @@ HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
             IntersectClipRect(hdc, prc->left, prc->top, prc->right, prc->bottom);
     }
     else {
-        GetClientRect(hParent, &rt);
-        MapWindowPoints(hParent, NULL, (LPPOINT)&rt, 2);
+        GetClientRect(hwnd, &rt);
+        MapWindowPoints(hwnd, hParent, (LPPOINT)&rt, 2);
     }
 
     OffsetViewportOrgEx(hdc, -rt.left, -rt.top, &org);