user32: convert screen coordinates for send WM_SIZING message
authorKonstantin Kondratyuk <kondratyuk@etersoft.ru>
Fri, 9 Apr 2010 10:07:02 +0000 (14:07 +0400)
committerVitaly Perov <vitperov@etersoft.ru>
Mon, 27 Sep 2010 09:45:53 +0000 (13:45 +0400)
dlls/user32/winpos.c

index 9180b719853f04e96e1988041f15880e2dc15b30..bc011cb02059f8a174a78c2652de2378682da964 100644 (file)
@@ -2633,6 +2633,7 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
             else
             {
                 WPARAM wpSizingHit = 0;
+                BOOL converted = FALSE;
 
                 if(!iconic && !DragFullWindows) draw_moving_frame( parent, hdc, &sizingRect, thickframe );
                 if (hittest == HTCAPTION) OffsetRect( &sizingRect, dx, dy );
@@ -2642,11 +2643,24 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
                 else if (ON_BOTTOM_BORDER(hittest)) sizingRect.bottom += dy;
                 capturePoint = pt;
 
+                /* convert to screen coordinates */
+                if(parent)
+                {
+                    POINT* p = (POINT*) &sizingRect;
+                    ClientToScreen( parent, p );
+                    ClientToScreen( parent, ++p );
+                    converted = TRUE;
+                }
+
                 /* determine the hit location */
                 if (hittest >= HTLEFT && hittest <= HTBOTTOMRIGHT)
                     wpSizingHit = WMSZ_LEFT + (hittest - HTLEFT);
                 SendMessageW( hwnd, WM_SIZING, wpSizingHit, (LPARAM)&sizingRect );
 
+                /* convert back to client coordinates id needed */
+                if(converted)
+                    MapWindowPoints( 0, parent, (POINT*)&sizingRect, 2 );
+
                 if (!iconic)
                 {
                     if(!DragFullWindows)