Alexandre Julliard : comctl32/datetime: Fix incorrect use of the ScreenToClient function.

Alexandre Julliard julliard at winehq.org
Tue Oct 5 12:03:10 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Oct  5 14:03:33 2010 +0200

comctl32/datetime: Fix incorrect use of the ScreenToClient function.

---

 dlls/comctl32/datetime.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index 6204cd1..1ac6ba7 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -787,6 +787,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y)
 
     if (infoPtr->select == DTHT_MCPOPUP) {
         RECT rcMonthCal;
+        POINT pos;
         SendMessageW(infoPtr->hMonthCal, MCM_GETMINREQRECT, 0, (LPARAM)&rcMonthCal);
 
         /* FIXME: button actually is only depressed during dropdown of the */
@@ -795,17 +796,16 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y)
 
         /* recalculate the position of the monthcal popup */
         if(infoPtr->dwStyle & DTS_RIGHTALIGN)
-            infoPtr->monthcal_pos.x = infoPtr->calbutton.left - 
-                (rcMonthCal.right - rcMonthCal.left);
+            pos.x = infoPtr->calbutton.left - (rcMonthCal.right - rcMonthCal.left);
         else
             /* FIXME: this should be after the area reserved for the checkbox */
-            infoPtr->monthcal_pos.x = infoPtr->rcDraw.left;
+            pos.x = infoPtr->rcDraw.left;
 
-        infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom;
-        ClientToScreen (infoPtr->hwndSelf, &(infoPtr->monthcal_pos));
-        SetWindowPos(infoPtr->hMonthCal, 0, infoPtr->monthcal_pos.x,
-            infoPtr->monthcal_pos.y, rcMonthCal.right - rcMonthCal.left,
-            rcMonthCal.bottom - rcMonthCal.top, 0);
+        pos.y = infoPtr->rcClient.bottom;
+        OffsetRect( &rcMonthCal, pos.x, pos.y );
+        MapWindowPoints( infoPtr->hwndSelf, 0, (POINT *)&rcMonthCal, 2 );
+        SetWindowPos(infoPtr->hMonthCal, 0, rcMonthCal.left, rcMonthCal.top,
+                     rcMonthCal.right - rcMonthCal.left, rcMonthCal.bottom - rcMonthCal.top, 0);
 
         if(IsWindowVisible(infoPtr->hMonthCal)) {
             ShowWindow(infoPtr->hMonthCal, SW_HIDE);




More information about the wine-cvs mailing list