X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/e73667f337301c82c515562f5c79a54fd40d4c55..fd64843f65a0d3c42de6af051c490af75a6b4862:/windows/winctrls.c?ds=sidebyside diff --git a/windows/winctrls.c b/windows/winctrls.c index 6d0b21cf..9ef09b7d 100644 --- a/windows/winctrls.c +++ b/windows/winctrls.c @@ -1039,6 +1039,10 @@ int handle_prefslist(struct prefslist *hdl, int dest = 0; /* initialise to placate gcc */ switch (dlm->uNotification) { case DL_BEGINDRAG: + /* Add a dummy item to make pl_itemfrompt() work + * better. + * FIXME: this causes scrollbar glitches if the count of + * listbox contains >= its height. */ hdl->dummyitem = SendDlgItemMessage(hwnd, hdl->listid, LB_ADDSTRING, 0, (LPARAM) ""); @@ -1046,7 +1050,7 @@ int handle_prefslist(struct prefslist *hdl, hdl->srcitem = LBItemFromPt(dlm->hWnd, dlm->ptCursor, TRUE); hdl->dragging = 0; /* XXX hack Q183115 */ - SetWindowLong(hwnd, DWL_MSGRESULT, TRUE); + SetWindowLongPtr(hwnd, DWLP_MSGRESULT, TRUE); ret |= 1; break; case DL_CANCELDRAG: DrawInsert(hwnd, dlm->hWnd, -1); /* Clear arrow */ @@ -1060,9 +1064,9 @@ int handle_prefslist(struct prefslist *hdl, if (dest > hdl->dummyitem) dest = hdl->dummyitem; DrawInsert (hwnd, dlm->hWnd, dest); if (dest >= 0) - SetWindowLong(hwnd, DWL_MSGRESULT, DL_MOVECURSOR); + SetWindowLongPtr(hwnd, DWLP_MSGRESULT, DL_MOVECURSOR); else - SetWindowLong(hwnd, DWL_MSGRESULT, DL_STOPCURSOR); + SetWindowLongPtr(hwnd, DWLP_MSGRESULT, DL_STOPCURSOR); ret |= 1; break; case DL_DROPPED: if (hdl->dragging) {