X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinctrls.c;h=9ef09b7d69e60bb89d70942ebbeaa5c14a45690f;hb=69ac38c1a847348de4c05fd4e19abf17a10de8b3;hp=6d0b21cf9b02659e21a441a2eda32a438bda788a;hpb=f481acb4792d56818509d8b756d3ae4c96c060d4;p=PuTTY.git 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) {