Commit a79c534c authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid using the MAKEPOINTS macro, it's broken on big endian.

parent 73e8baff
...@@ -1910,7 +1910,8 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -1910,7 +1910,8 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
rect.bottom = rect.top + SendMessageW(infoPtr->hwndSelf, rect.bottom = rect.top + SendMessageW(infoPtr->hwndSelf,
CB_GETITEMHEIGHT, -1, 0); CB_GETITEMHEIGHT, -1, 0);
rect.left = rect.right - GetSystemMetrics(SM_CXVSCROLL); rect.left = rect.right - GetSystemMetrics(SM_CXVSCROLL);
POINTSTOPOINT(pt, MAKEPOINTS(lParam)); pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam);
if (PtInRect(&rect, pt)) if (PtInRect(&rect, pt))
return CallWindowProcW (infoPtr->prevComboWndProc, return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam); hwnd, uMsg, wParam, lParam);
......
...@@ -563,11 +563,15 @@ DATETIME_HitTest (DATETIME_INFO *infoPtr, POINT pt) ...@@ -563,11 +563,15 @@ DATETIME_HitTest (DATETIME_INFO *infoPtr, POINT pt)
static LRESULT static LRESULT
DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, POINTS pts) DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y)
{ {
POINT pt = { pts.x, pts.y }; POINT pt;
int old = infoPtr->select; int old, new;
int new = DATETIME_HitTest (infoPtr, pt);
pt.x = x;
pt.y = y;
old = infoPtr->select;
new = DATETIME_HitTest (infoPtr, pt);
/* FIXME: might be conditions where we don't want to update infoPtr->select */ /* FIXME: might be conditions where we don't want to update infoPtr->select */
infoPtr->select = new; infoPtr->select = new;
...@@ -614,7 +618,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, POINTS pts) ...@@ -614,7 +618,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, POINTS pts)
static LRESULT static LRESULT
DATETIME_LButtonUp (DATETIME_INFO *infoPtr, WORD wKey, POINTS pts) DATETIME_LButtonUp (DATETIME_INFO *infoPtr, WORD wKey)
{ {
if(infoPtr->bCalDepressed == TRUE) { if(infoPtr->bCalDepressed == TRUE) {
infoPtr->bCalDepressed = FALSE; infoPtr->bCalDepressed = FALSE;
...@@ -1003,10 +1007,10 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -1003,10 +1007,10 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DATETIME_Size (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); return DATETIME_Size (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
return DATETIME_LButtonDown (infoPtr, (WORD)wParam, MAKEPOINTS(lParam)); return DATETIME_LButtonDown (infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_LBUTTONUP: case WM_LBUTTONUP:
return DATETIME_LButtonUp (infoPtr, (WORD)wParam, MAKEPOINTS(lParam)); return DATETIME_LButtonUp (infoPtr, (WORD)wParam);
case WM_CREATE: case WM_CREATE:
return DATETIME_Create (hwnd, (LPCREATESTRUCTW)lParam); return DATETIME_Create (hwnd, (LPCREATESTRUCTW)lParam);
......
...@@ -3140,7 +3140,7 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem) ...@@ -3140,7 +3140,7 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem)
* PARAMETER(S): * PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure * [I] infoPtr : valid pointer to the listview structure
* [I] fwKeys : key indicator * [I] fwKeys : key indicator
* [I] pts : mouse position * [I] x,y : mouse position
* *
* RETURN: * RETURN:
* 0 if the message was processed, non-zero if there was an error * 0 if the message was processed, non-zero if there was an error
...@@ -3150,7 +3150,7 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem) ...@@ -3150,7 +3150,7 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem)
* over the item for a certain period of time. * over the item for a certain period of time.
* *
*/ */
static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKyes, POINTS pts) static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKyes, INT x, INT y)
{ {
if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT)
/* FIXME: select the item!!! */ /* FIXME: select the item!!! */
...@@ -3166,12 +3166,12 @@ static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKyes, POINTS p ...@@ -3166,12 +3166,12 @@ static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKyes, POINTS p
* PARAMETER(S): * PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure * [I] infoPtr : valid pointer to the listview structure
* [I] fwKeys : key indicator * [I] fwKeys : key indicator
* [I] pts : mouse position * [I] x,y : mouse position
* *
* RETURN: * RETURN:
* 0 if the message is processed, non-zero if there was an error * 0 if the message is processed, non-zero if there was an error
*/ */
static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, POINTS pts) static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, INT y)
{ {
TRACKMOUSEEVENT trackinfo; TRACKMOUSEEVENT trackinfo;
...@@ -7960,22 +7960,22 @@ static LRESULT LISTVIEW_TrackMouse(LISTVIEW_INFO *infoPtr, POINT pt) ...@@ -7960,22 +7960,22 @@ static LRESULT LISTVIEW_TrackMouse(LISTVIEW_INFO *infoPtr, POINT pt)
* PARAMETER(S): * PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure * [I] infoPtr : valid pointer to the listview structure
* [I] wKey : key flag * [I] wKey : key flag
* [I] pts : mouse coordinate * [I] x,y : mouse coordinate
* *
* RETURN: * RETURN:
* Zero * Zero
*/ */
static LRESULT LISTVIEW_LButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pts) static LRESULT LISTVIEW_LButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
{ {
LVHITTESTINFO htInfo; LVHITTESTINFO htInfo;
TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, pts.x, pts.y); TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y);
/* send NM_RELEASEDCAPTURE notification */ /* send NM_RELEASEDCAPTURE notification */
notify(infoPtr, NM_RELEASEDCAPTURE); notify(infoPtr, NM_RELEASEDCAPTURE);
htInfo.pt.x = pts.x; htInfo.pt.x = x;
htInfo.pt.y = pts.y; htInfo.pt.y = y;
/* send NM_DBLCLK notification */ /* send NM_DBLCLK notification */
LISTVIEW_HitTest(infoPtr, &htInfo, TRUE, FALSE); LISTVIEW_HitTest(infoPtr, &htInfo, TRUE, FALSE);
...@@ -7994,19 +7994,19 @@ static LRESULT LISTVIEW_LButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS ...@@ -7994,19 +7994,19 @@ static LRESULT LISTVIEW_LButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS
* PARAMETER(S): * PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure * [I] infoPtr : valid pointer to the listview structure
* [I] wKey : key flag * [I] wKey : key flag
* [I] pts : mouse coordinate * [I] x,y : mouse coordinate
* *
* RETURN: * RETURN:
* Zero * Zero
*/ */
static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pts) static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
{ {
LVHITTESTINFO lvHitTestInfo; LVHITTESTINFO lvHitTestInfo;
static BOOL bGroupSelect = TRUE; static BOOL bGroupSelect = TRUE;
POINT pt = { pts.x, pts.y }; POINT pt = { x, y };
INT nItem; INT nItem;
TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, pts.x, pts.y); TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y);
/* send NM_RELEASEDCAPTURE notification */ /* send NM_RELEASEDCAPTURE notification */
notify(infoPtr, NM_RELEASEDCAPTURE); notify(infoPtr, NM_RELEASEDCAPTURE);
...@@ -8016,8 +8016,8 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pt ...@@ -8016,8 +8016,8 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pt
/* set left button down flag */ /* set left button down flag */
infoPtr->bLButtonDown = TRUE; infoPtr->bLButtonDown = TRUE;
lvHitTestInfo.pt.x = pts.x; lvHitTestInfo.pt.x = x;
lvHitTestInfo.pt.y = pts.y; lvHitTestInfo.pt.y = y;
nItem = LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE); nItem = LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE);
TRACE("at %s, nItem=%d\n", debugpoint(&pt), nItem); TRACE("at %s, nItem=%d\n", debugpoint(&pt), nItem);
...@@ -8121,21 +8121,21 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pt ...@@ -8121,21 +8121,21 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pt
* PARAMETER(S): * PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure * [I] infoPtr : valid pointer to the listview structure
* [I] wKey : key flag * [I] wKey : key flag
* [I] pts : mouse coordinate * [I] x,y : mouse coordinate
* *
* RETURN: * RETURN:
* Zero * Zero
*/ */
static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pts) static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
{ {
LVHITTESTINFO lvHitTestInfo; LVHITTESTINFO lvHitTestInfo;
TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, pts.x, pts.y); TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y);
if (!infoPtr->bLButtonDown) return 0; if (!infoPtr->bLButtonDown) return 0;
lvHitTestInfo.pt.x = pts.x; lvHitTestInfo.pt.x = x;
lvHitTestInfo.pt.y = pts.y; lvHitTestInfo.pt.y = y;
/* send NM_CLICK notification */ /* send NM_CLICK notification */
LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, FALSE); LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, FALSE);
...@@ -8353,23 +8353,23 @@ static LRESULT LISTVIEW_Paint(LISTVIEW_INFO *infoPtr, HDC hdc) ...@@ -8353,23 +8353,23 @@ static LRESULT LISTVIEW_Paint(LISTVIEW_INFO *infoPtr, HDC hdc)
* PARAMETER(S): * PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure * [I] infoPtr : valid pointer to the listview structure
* [I] wKey : key flag * [I] wKey : key flag
* [I] pts : mouse coordinate * [I] x,y : mouse coordinate
* *
* RETURN: * RETURN:
* Zero * Zero
*/ */
static LRESULT LISTVIEW_RButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pts) static LRESULT LISTVIEW_RButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
{ {
LVHITTESTINFO lvHitTestInfo; LVHITTESTINFO lvHitTestInfo;
TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, pts.x, pts.y); TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y);
/* send NM_RELEASEDCAPTURE notification */ /* send NM_RELEASEDCAPTURE notification */
notify(infoPtr, NM_RELEASEDCAPTURE); notify(infoPtr, NM_RELEASEDCAPTURE);
/* send NM_RDBLCLK notification */ /* send NM_RDBLCLK notification */
lvHitTestInfo.pt.x = pts.x; lvHitTestInfo.pt.x = x;
lvHitTestInfo.pt.y = pts.y; lvHitTestInfo.pt.y = y;
LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, FALSE); LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, FALSE);
notify_click(infoPtr, NM_RDBLCLK, &lvHitTestInfo); notify_click(infoPtr, NM_RDBLCLK, &lvHitTestInfo);
...@@ -8383,17 +8383,17 @@ static LRESULT LISTVIEW_RButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS ...@@ -8383,17 +8383,17 @@ static LRESULT LISTVIEW_RButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS
* PARAMETER(S): * PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure * [I] infoPtr : valid pointer to the listview structure
* [I] wKey : key flag * [I] wKey : key flag
* [I] pts : mouse coordinate * [I] x,y : mouse coordinate
* *
* RETURN: * RETURN:
* Zero * Zero
*/ */
static LRESULT LISTVIEW_RButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pts) static LRESULT LISTVIEW_RButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
{ {
LVHITTESTINFO lvHitTestInfo; LVHITTESTINFO lvHitTestInfo;
INT nItem; INT nItem;
TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, pts.x, pts.y); TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y);
/* send NM_RELEASEDCAPTURE notification */ /* send NM_RELEASEDCAPTURE notification */
notify(infoPtr, NM_RELEASEDCAPTURE); notify(infoPtr, NM_RELEASEDCAPTURE);
...@@ -8405,8 +8405,8 @@ static LRESULT LISTVIEW_RButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pt ...@@ -8405,8 +8405,8 @@ static LRESULT LISTVIEW_RButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pt
infoPtr->bRButtonDown = TRUE; infoPtr->bRButtonDown = TRUE;
/* determine the index of the selected item */ /* determine the index of the selected item */
lvHitTestInfo.pt.x = pts.x; lvHitTestInfo.pt.x = x;
lvHitTestInfo.pt.y = pts.y; lvHitTestInfo.pt.y = y;
nItem = LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE); nItem = LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE);
if ((nItem >= 0) && (nItem < infoPtr->nItemCount)) if ((nItem >= 0) && (nItem < infoPtr->nItemCount))
...@@ -8431,17 +8431,17 @@ static LRESULT LISTVIEW_RButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pt ...@@ -8431,17 +8431,17 @@ static LRESULT LISTVIEW_RButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pt
* PARAMETER(S): * PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure * [I] infoPtr : valid pointer to the listview structure
* [I] wKey : key flag * [I] wKey : key flag
* [I] pts : mouse coordinate * [I] x,y : mouse coordinate
* *
* RETURN: * RETURN:
* Zero * Zero
*/ */
static LRESULT LISTVIEW_RButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pts) static LRESULT LISTVIEW_RButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
{ {
LVHITTESTINFO lvHitTestInfo; LVHITTESTINFO lvHitTestInfo;
POINT pt; POINT pt;
TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, pts.x, pts.y); TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y);
if (!infoPtr->bRButtonDown) return 0; if (!infoPtr->bRButtonDown) return 0;
...@@ -8449,8 +8449,8 @@ static LRESULT LISTVIEW_RButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pts) ...@@ -8449,8 +8449,8 @@ static LRESULT LISTVIEW_RButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, POINTS pts)
infoPtr->bRButtonDown = FALSE; infoPtr->bRButtonDown = FALSE;
/* Send NM_RClICK notification */ /* Send NM_RClICK notification */
lvHitTestInfo.pt.x = pts.x; lvHitTestInfo.pt.x = x;
lvHitTestInfo.pt.y = pts.y; lvHitTestInfo.pt.y = y;
LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, FALSE); LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, FALSE);
notify_click(infoPtr, NM_RCLICK, &lvHitTestInfo); notify_click(infoPtr, NM_RCLICK, &lvHitTestInfo);
...@@ -9168,19 +9168,19 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -9168,19 +9168,19 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return LISTVIEW_KillFocus(infoPtr); return LISTVIEW_KillFocus(infoPtr);
case WM_LBUTTONDBLCLK: case WM_LBUTTONDBLCLK:
return LISTVIEW_LButtonDblClk(infoPtr, (WORD)wParam, MAKEPOINTS(lParam)); return LISTVIEW_LButtonDblClk(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
return LISTVIEW_LButtonDown(infoPtr, (WORD)wParam, MAKEPOINTS(lParam)); return LISTVIEW_LButtonDown(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_LBUTTONUP: case WM_LBUTTONUP:
return LISTVIEW_LButtonUp(infoPtr, (WORD)wParam, MAKEPOINTS(lParam)); return LISTVIEW_LButtonUp(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return LISTVIEW_MouseMove (infoPtr, (WORD)wParam, MAKEPOINTS(lParam)); return LISTVIEW_MouseMove (infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_MOUSEHOVER: case WM_MOUSEHOVER:
return LISTVIEW_MouseHover(infoPtr, (WORD)wParam, MAKEPOINTS(lParam)); return LISTVIEW_MouseHover(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_NCDESTROY: case WM_NCDESTROY:
return LISTVIEW_NCDestroy(infoPtr); return LISTVIEW_NCDestroy(infoPtr);
...@@ -9197,13 +9197,13 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -9197,13 +9197,13 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return LISTVIEW_Paint(infoPtr, (HDC)wParam); return LISTVIEW_Paint(infoPtr, (HDC)wParam);
case WM_RBUTTONDBLCLK: case WM_RBUTTONDBLCLK:
return LISTVIEW_RButtonDblClk(infoPtr, (WORD)wParam, MAKEPOINTS(lParam)); return LISTVIEW_RButtonDblClk(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN:
return LISTVIEW_RButtonDown(infoPtr, (WORD)wParam, MAKEPOINTS(lParam)); return LISTVIEW_RButtonDown(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_RBUTTONUP: case WM_RBUTTONUP:
return LISTVIEW_RButtonUp(infoPtr, (WORD)wParam, MAKEPOINTS(lParam)); return LISTVIEW_RButtonUp(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_SETCURSOR: case WM_SETCURSOR:
if(LISTVIEW_SetCursor(infoPtr, (HWND)wParam, LOWORD(lParam), HIWORD(lParam))) if(LISTVIEW_SetCursor(infoPtr, (HWND)wParam, LOWORD(lParam), HIWORD(lParam)))
......
...@@ -194,8 +194,8 @@ typedef struct ...@@ -194,8 +194,8 @@ typedef struct
HCURSOR hcurVert; /* handle to the NS cursor */ HCURSOR hcurVert; /* handle to the NS cursor */
HCURSOR hcurDrag; /* handle to the drag cursor */ HCURSOR hcurDrag; /* handle to the drag cursor */
INT iVersion; /* version number */ INT iVersion; /* version number */
POINTS dragStart; /* x,y of button down */ POINT dragStart; /* x,y of button down */
POINTS dragNow; /* x,y of this MouseMove */ POINT dragNow; /* x,y of this MouseMove */
INT iOldBand; /* last band that had the mouse cursor over it */ INT iOldBand; /* last band that had the mouse cursor over it */
INT ihitoffset; /* offset of hotspot from gripper.left */ INT ihitoffset; /* offset of hotspot from gripper.left */
POINT origin; /* left/upper corner of client */ POINT origin; /* left/upper corner of client */
...@@ -394,7 +394,7 @@ REBAR_DumpBand (REBAR_INFO *iP) ...@@ -394,7 +394,7 @@ REBAR_DumpBand (REBAR_INFO *iP)
TRACE("hwnd=%p: color=%08lx/%08lx, bands=%u, rows=%u, cSize=%ld,%ld\n", TRACE("hwnd=%p: color=%08lx/%08lx, bands=%u, rows=%u, cSize=%ld,%ld\n",
iP->hwndSelf, iP->clrText, iP->clrBk, iP->uNumBands, iP->uNumRows, iP->hwndSelf, iP->clrText, iP->clrBk, iP->uNumBands, iP->uNumRows,
iP->calcSize.cx, iP->calcSize.cy); iP->calcSize.cx, iP->calcSize.cy);
TRACE("hwnd=%p: flags=%08x, dragStart=%d,%d, dragNow=%d,%d, iGrabbedBand=%d\n", TRACE("hwnd=%p: flags=%08x, dragStart=%ld,%ld, dragNow=%ld,%ld, iGrabbedBand=%d\n",
iP->hwndSelf, iP->fStatus, iP->dragStart.x, iP->dragStart.y, iP->hwndSelf, iP->fStatus, iP->dragStart.x, iP->dragStart.y,
iP->dragNow.x, iP->dragNow.y, iP->dragNow.x, iP->dragNow.y,
iP->iGrabbedBand); iP->iGrabbedBand);
...@@ -2418,7 +2418,7 @@ REBAR_Shrink (REBAR_INFO *infoPtr, REBAR_BAND *band, INT movement, INT i) ...@@ -2418,7 +2418,7 @@ REBAR_Shrink (REBAR_INFO *infoPtr, REBAR_BAND *band, INT movement, INT i)
static void static void
REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove) REBAR_HandleLRDrag (REBAR_INFO *infoPtr, const POINT *ptsmove)
/* Function: This will implement the functionality of a */ /* Function: This will implement the functionality of a */
/* Gripper drag within a row. It will not implement "out- */ /* Gripper drag within a row. It will not implement "out- */
/* of-row" drags. (They are detected and handled in */ /* of-row" drags. (They are detected and handled in */
...@@ -2491,7 +2491,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove) ...@@ -2491,7 +2491,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove)
infoPtr->ihitoffset); infoPtr->ihitoffset);
infoPtr->dragNow = *ptsmove; infoPtr->dragNow = *ptsmove;
TRACE("before: movement=%d (%d,%d), imindBand=%d, ihitBand=%d, imaxdBand=%d, LSum=%d, RSum=%d\n", TRACE("before: movement=%d (%ld,%ld), imindBand=%d, ihitBand=%d, imaxdBand=%d, LSum=%d, RSum=%d\n",
movement, ptsmove->x, ptsmove->y, imindBand, ihitBand, movement, ptsmove->x, ptsmove->y, imindBand, ihitBand,
imaxdBand, LHeaderSum, RHeaderSum); imaxdBand, LHeaderSum, RHeaderSum);
REBAR_DumpBand (infoPtr); REBAR_DumpBand (infoPtr);
...@@ -3874,7 +3874,8 @@ REBAR_LButtonDown (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) ...@@ -3874,7 +3874,8 @@ REBAR_LButtonDown (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
infoPtr->iGrabbedBand = iHitBand; infoPtr->iGrabbedBand = iHitBand;
/* save off the LOWORD and HIWORD of lParam as initial x,y */ /* save off the LOWORD and HIWORD of lParam as initial x,y */
infoPtr->dragStart = MAKEPOINTS(lParam); infoPtr->dragStart.x = (short)LOWORD(lParam);
infoPtr->dragStart.y = (short)HIWORD(lParam);
infoPtr->dragNow = infoPtr->dragStart; infoPtr->dragNow = infoPtr->dragStart;
if (infoPtr->dwStyle & CCS_VERT) if (infoPtr->dwStyle & CCS_VERT)
infoPtr->ihitoffset = infoPtr->dragStart.y - (lpBand->rcBand.top+REBAR_PRE_GRIPPER); infoPtr->ihitoffset = infoPtr->dragStart.y - (lpBand->rcBand.top+REBAR_PRE_GRIPPER);
...@@ -3935,9 +3936,10 @@ static LRESULT ...@@ -3935,9 +3936,10 @@ static LRESULT
REBAR_MouseMove (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_MouseMove (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{ {
REBAR_BAND *lpChevronBand; REBAR_BAND *lpChevronBand;
POINTS ptsmove; POINT ptMove;
ptsmove = MAKEPOINTS(lParam); ptMove.x = (short)LOWORD(lParam);
ptMove.y = (short)HIWORD(lParam);
/* if we are currently dragging a band */ /* if we are currently dragging a band */
if (infoPtr->iGrabbedBand >= 0) if (infoPtr->iGrabbedBand >= 0)
...@@ -3951,40 +3953,37 @@ REBAR_MouseMove (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) ...@@ -3951,40 +3953,37 @@ REBAR_MouseMove (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
band2 = &infoPtr->bands[infoPtr->iGrabbedBand]; band2 = &infoPtr->bands[infoPtr->iGrabbedBand];
/* if mouse did not move much, exit */ /* if mouse did not move much, exit */
if ((abs(ptsmove.x - infoPtr->dragNow.x) <= mindragx) && if ((abs(ptMove.x - infoPtr->dragNow.x) <= mindragx) &&
(abs(ptsmove.y - infoPtr->dragNow.y) <= mindragy)) return 0; (abs(ptMove.y - infoPtr->dragNow.y) <= mindragy)) return 0;
/* Test for valid drag case - must not be first band in row */ /* Test for valid drag case - must not be first band in row */
if (infoPtr->dwStyle & CCS_VERT) { if (infoPtr->dwStyle & CCS_VERT) {
if ((ptsmove.x < band2->rcBand.left) || if ((ptMove.x < band2->rcBand.left) ||
(ptsmove.x > band2->rcBand.right) || (ptMove.x > band2->rcBand.right) ||
((infoPtr->iGrabbedBand > 0) && (band1->iRow != band2->iRow))) { ((infoPtr->iGrabbedBand > 0) && (band1->iRow != band2->iRow))) {
FIXME("Cannot drag to other rows yet!!\n"); FIXME("Cannot drag to other rows yet!!\n");
} }
else { else {
REBAR_HandleLRDrag (infoPtr, &ptsmove); REBAR_HandleLRDrag (infoPtr, &ptMove);
} }
} }
else { else {
if ((ptsmove.y < band2->rcBand.top) || if ((ptMove.y < band2->rcBand.top) ||
(ptsmove.y > band2->rcBand.bottom) || (ptMove.y > band2->rcBand.bottom) ||
((infoPtr->iGrabbedBand > 0) && (band1->iRow != band2->iRow))) { ((infoPtr->iGrabbedBand > 0) && (band1->iRow != band2->iRow))) {
FIXME("Cannot drag to other rows yet!!\n"); FIXME("Cannot drag to other rows yet!!\n");
} }
else { else {
REBAR_HandleLRDrag (infoPtr, &ptsmove); REBAR_HandleLRDrag (infoPtr, &ptMove);
} }
} }
} }
else else
{ {
POINT ptMove;
INT iHitBand; INT iHitBand;
UINT htFlags; UINT htFlags;
TRACKMOUSEEVENT trackinfo; TRACKMOUSEEVENT trackinfo;
ptMove.x = (INT)ptsmove.x;
ptMove.y = (INT)ptsmove.y;
REBAR_InternalHitTest(infoPtr, &ptMove, &htFlags, &iHitBand); REBAR_InternalHitTest(infoPtr, &ptMove, &htFlags, &iHitBand);
if (infoPtr->iOldBand >= 0 && infoPtr->iOldBand == infoPtr->ichevronhotBand) if (infoPtr->iOldBand >= 0 && infoPtr->iOldBand == infoPtr->ichevronhotBand)
...@@ -4152,8 +4151,7 @@ static LRESULT ...@@ -4152,8 +4151,7 @@ static LRESULT
REBAR_NCHitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_NCHitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{ {
NMMOUSE nmmouse; NMMOUSE nmmouse;
POINTS shortpt; POINT clpt;
POINT clpt, pt;
INT i; INT i;
UINT scrap; UINT scrap;
LRESULT ret = HTCLIENT; LRESULT ret = HTCLIENT;
...@@ -4166,9 +4164,8 @@ REBAR_NCHitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) ...@@ -4166,9 +4164,8 @@ REBAR_NCHitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
* 3. native always seems to return HTCLIENT if notify return is 0. * 3. native always seems to return HTCLIENT if notify return is 0.
*/ */
shortpt = MAKEPOINTS (lParam); clpt.x = (short)LOWORD(lParam);
POINTSTOPOINT(pt, shortpt); clpt.y = (short)HIWORD(lParam);
clpt = pt;
ScreenToClient (infoPtr->hwndSelf, &clpt); ScreenToClient (infoPtr->hwndSelf, &clpt);
REBAR_InternalHitTest (infoPtr, &clpt, &scrap, REBAR_InternalHitTest (infoPtr, &clpt, &scrap,
(INT *)&nmmouse.dwItemSpec); (INT *)&nmmouse.dwItemSpec);
......
...@@ -1478,12 +1478,10 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message, ...@@ -1478,12 +1478,10 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
case WM_SETCURSOR: case WM_SETCURSOR:
{ {
LHITTESTINFO ht; LHITTESTINFO ht;
POINTS pt;
DWORD mp = GetMessagePos(); DWORD mp = GetMessagePos();
pt = MAKEPOINTS(mp); ht.pt.x = (short)LOWORD(mp);
ht.pt.x = pt.x; ht.pt.y = (short)HIWORD(mp);
ht.pt.y = pt.y;
ScreenToClient(infoPtr->Self, &ht.pt); ScreenToClient(infoPtr->Self, &ht.pt);
if(SYSLINK_HitTest (infoPtr, &ht)) if(SYSLINK_HitTest (infoPtr, &ht))
......
...@@ -1418,9 +1418,12 @@ TRACKBAR_KillFocus (TRACKBAR_INFO *infoPtr, HWND hwndGetFocus) ...@@ -1418,9 +1418,12 @@ TRACKBAR_KillFocus (TRACKBAR_INFO *infoPtr, HWND hwndGetFocus)
} }
static LRESULT static LRESULT
TRACKBAR_LButtonDown (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts) TRACKBAR_LButtonDown (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y)
{ {
POINT clickPoint = { pts.x, pts.y }; POINT clickPoint;
clickPoint.x = x;
clickPoint.y = y;
SetFocus(infoPtr->hwndSelf); SetFocus(infoPtr->hwndSelf);
...@@ -1444,7 +1447,7 @@ TRACKBAR_LButtonDown (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts) ...@@ -1444,7 +1447,7 @@ TRACKBAR_LButtonDown (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts)
static LRESULT static LRESULT
TRACKBAR_LButtonUp (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts) TRACKBAR_LButtonUp (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y)
{ {
if (infoPtr->flags & TB_DRAG_MODE) { if (infoPtr->flags & TB_DRAG_MODE) {
notify_with_scroll (infoPtr, TB_THUMBPOSITION | (infoPtr->lPos<<16)); notify_with_scroll (infoPtr, TB_THUMBPOSITION | (infoPtr->lPos<<16));
...@@ -1526,17 +1529,18 @@ TRACKBAR_Timer (TRACKBAR_INFO *infoPtr, INT wTimerID, TIMERPROC *tmrpc) ...@@ -1526,17 +1529,18 @@ TRACKBAR_Timer (TRACKBAR_INFO *infoPtr, INT wTimerID, TIMERPROC *tmrpc)
static LRESULT static LRESULT
TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts) TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y)
{ {
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE); DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
INT clickPlace = (dwStyle & TBS_VERT) ? pts.y : pts.x; INT clickPlace = (dwStyle & TBS_VERT) ? y : x;
LONG dragPos, oldPos = infoPtr->lPos; LONG dragPos, oldPos = infoPtr->lPos;
TRACE("(x=%d. y=%d)\n", pts.x, pts.y); TRACE("(x=%d. y=%d)\n", x, y);
if (infoPtr->flags & TB_AUTO_PAGE) { if (infoPtr->flags & TB_AUTO_PAGE) {
POINT pt; POINT pt;
POINTSTOPOINT(pt, pts); pt.x = x;
pt.y = y;
TRACKBAR_AutoPage (infoPtr, pt); TRACKBAR_AutoPage (infoPtr, pt);
return TRUE; return TRUE;
} }
...@@ -1778,13 +1782,13 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -1778,13 +1782,13 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TRACKBAR_KillFocus (infoPtr, (HWND)wParam); return TRACKBAR_KillFocus (infoPtr, (HWND)wParam);
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
return TRACKBAR_LButtonDown (infoPtr, wParam, MAKEPOINTS(lParam)); return TRACKBAR_LButtonDown (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_LBUTTONUP: case WM_LBUTTONUP:
return TRACKBAR_LButtonUp (infoPtr, wParam, MAKEPOINTS(lParam)); return TRACKBAR_LButtonUp (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return TRACKBAR_MouseMove (infoPtr, wParam, MAKEPOINTS(lParam)); return TRACKBAR_MouseMove (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_PAINT: case WM_PAINT:
return TRACKBAR_Paint (infoPtr, (HDC)wParam); return TRACKBAR_Paint (infoPtr, (HDC)wParam);
......
...@@ -650,10 +650,10 @@ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr) ...@@ -650,10 +650,10 @@ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr)
* 'pt' is the location of the mouse event in client or * 'pt' is the location of the mouse event in client or
* windows coordinates. * windows coordinates.
*/ */
static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINTS pts) static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, INT x, INT y)
{ {
DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE); DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE);
POINT pt = { pts.x, pts.y }; POINT pt = { x, y };
RECT rect; RECT rect;
int temp, arrow; int temp, arrow;
...@@ -840,7 +840,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L ...@@ -840,7 +840,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
if(UPDOWN_IsEnabled(infoPtr)) if(UPDOWN_IsEnabled(infoPtr))
UPDOWN_HandleMouseEvent (infoPtr, message, MAKEPOINTS(lParam)); UPDOWN_HandleMouseEvent (infoPtr, message, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
break; break;
case WM_KEYDOWN: case WM_KEYDOWN:
......
...@@ -369,10 +369,10 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR ...@@ -369,10 +369,10 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
} }
break; break;
case WM_CONTEXTMENU: { case WM_CONTEXTMENU: {
POINTS pt = MAKEPOINTS(lParam);
int cnt = ListView_GetNextItem(hWnd, -1, LVNI_SELECTED); int cnt = ListView_GetNextItem(hWnd, -1, LVNI_SELECTED);
TrackPopupMenu(GetSubMenu(hPopupMenus, cnt == -1 ? PM_NEW : PM_MODIFYVALUE), TrackPopupMenu(GetSubMenu(hPopupMenus, cnt == -1 ? PM_NEW : PM_MODIFYVALUE),
TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL); TPM_RIGHTBUTTON, (short)LOWORD(lParam), (short)HIWORD(lParam),
0, hFrameWnd, NULL);
break; break;
} }
default: default:
......
...@@ -3667,8 +3667,9 @@ LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam ...@@ -3667,8 +3667,9 @@ LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
/* first select the current item in the listbox */ /* first select the current item in the listbox */
HWND hpanel = (HWND) wparam; HWND hpanel = (HWND) wparam;
POINTS* ppos = &MAKEPOINTS(lparam); POINT pt;
POINT pt; POINTSTOPOINT(pt, *ppos); pt.x = (short)LOWORD(lparam);
pt.y = (short)HIWORD(lparam);
ScreenToClient(hpanel, &pt); ScreenToClient(hpanel, &pt);
SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt.x, pt.y)); SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt.x, pt.y));
SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt.x, pt.y)); SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt.x, pt.y));
...@@ -3689,7 +3690,7 @@ LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam ...@@ -3689,7 +3690,7 @@ LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
/* get and use the parent folder to display correct context menu in all cases */ /* get and use the parent folder to display correct context menu in all cases */
if (SUCCEEDED(SHBindToParent(pidl_abs, &IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast))) { if (SUCCEEDED(SHBindToParent(pidl_abs, &IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast))) {
hr = ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, ppos->x, ppos->y); hr = ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pt.x, pt.y);
(*parentFolder->lpVtbl->Release)(parentFolder); (*parentFolder->lpVtbl->Release)(parentFolder);
} }
......
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