Mercurial > dwindows
comparison win/dw.c @ 1838:ca304f28de3b
Fix 64bit crashes on Windows when building with Visual Studio 2012.
LPARAM in 32bit mode is LONG, but in 64bit mode it is uint64...
There were casts to LONG in several places that were getting truncated
with the new version of the compiler (but not gcc or older versions).
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 16 Nov 2012 21:18:20 +0000 |
parents | 10c59bb2c47f |
children | 22225eb286e5 |
comparison
equal
deleted
inserted
replaced
1837:d7e13f446c41 | 1838:ca304f28de3b |
---|---|
6166 SendMessage(tmp, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); | 6166 SendMessage(tmp, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); |
6167 SendMessage(tmp, TB_SETBUTTONSIZE, 0, MAKELPARAM(bmi.bmWidth, bmi.bmHeight)); | 6167 SendMessage(tmp, TB_SETBUTTONSIZE, 0, MAKELPARAM(bmi.bmWidth, bmi.bmHeight)); |
6168 SendMessage(tmp, TB_SETPADDING, 0, 0); | 6168 SendMessage(tmp, TB_SETPADDING, 0, 0); |
6169 SendMessage(tmp, TB_SETIMAGELIST, 0, (LPARAM)imlist); | 6169 SendMessage(tmp, TB_SETIMAGELIST, 0, (LPARAM)imlist); |
6170 SendMessage(tmp, TB_SETDISABLEDIMAGELIST, 0, (LPARAM)dimlist); | 6170 SendMessage(tmp, TB_SETDISABLEDIMAGELIST, 0, (LPARAM)dimlist); |
6171 SendMessage(tmp, TB_ADDBUTTONS, 1, (LONG) &tbButtons); | 6171 SendMessage(tmp, TB_ADDBUTTONS, 1, (LPARAM) &tbButtons); |
6172 | 6172 |
6173 _create_tooltip(tmp, text); | 6173 _create_tooltip(tmp, text); |
6174 return tmp; | 6174 return tmp; |
6175 } | 6175 } |
6176 #endif | 6176 #endif |
6491 | 6491 |
6492 cinfo->back = cinfo->fore = -1; | 6492 cinfo->back = cinfo->fore = -1; |
6493 | 6493 |
6494 cinfo->pOldProc = SubclassWindow(tmp, _colorwndproc); | 6494 cinfo->pOldProc = SubclassWindow(tmp, _colorwndproc); |
6495 SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo); | 6495 SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo); |
6496 SendMessage(tmp, TBM_SETRANGE, (WPARAM)FALSE, (LPARAM)MAKELONG(0, increments-1)); | 6496 SendMessage(tmp, TBM_SETRANGE, (WPARAM)FALSE, MAKELPARAM(0, increments-1)); |
6497 return tmp; | 6497 return tmp; |
6498 } | 6498 } |
6499 | 6499 |
6500 /* | 6500 /* |
6501 * Create a new scrollbar window (widget) to be packed. | 6501 * Create a new scrollbar window (widget) to be packed. |
8394 * handle: Handle to the MLE to be positioned. | 8394 * handle: Handle to the MLE to be positioned. |
8395 * point: Point to position cursor. | 8395 * point: Point to position cursor. |
8396 */ | 8396 */ |
8397 void API dw_mle_set_cursor(HWND handle, int point) | 8397 void API dw_mle_set_cursor(HWND handle, int point) |
8398 { | 8398 { |
8399 SendMessage(handle, EM_SETSEL, 0, MAKELONG(point,point)); | 8399 SendMessage(handle, EM_SETSEL, 0, MAKELPARAM(point,point)); |
8400 SendMessage(handle, EM_SCROLLCARET, 0, 0); | 8400 SendMessage(handle, EM_SCROLLCARET, 0, 0); |
8401 } | 8401 } |
8402 | 8402 |
8403 /* | 8403 /* |
8404 * Finds text in an MLE box. | 8404 * Finds text in an MLE box. |
8694 ptrs[0] = title; | 8694 ptrs[0] = title; |
8695 ptrs[1] = itemdata; | 8695 ptrs[1] = itemdata; |
8696 | 8696 |
8697 tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; | 8697 tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; |
8698 tvi.pszText = UTF8toWide(title); | 8698 tvi.pszText = UTF8toWide(title); |
8699 tvi.lParam = (LONG)ptrs; | 8699 tvi.lParam = (LPARAM)ptrs; |
8700 tvi.cchTextMax = (int)_tcslen(tvi.pszText); | 8700 tvi.cchTextMax = (int)_tcslen(tvi.pszText); |
8701 tvi.iSelectedImage = tvi.iImage = _lookup_icon(handle, (HICON)icon, 1); | 8701 tvi.iSelectedImage = tvi.iImage = _lookup_icon(handle, (HICON)icon, 1); |
8702 | 8702 |
8703 tvins.item = tvi; | 8703 tvins.item = tvi; |
8704 tvins.hParent = parent; | 8704 tvins.hParent = parent; |
8728 ptrs[0] = title; | 8728 ptrs[0] = title; |
8729 ptrs[1] = itemdata; | 8729 ptrs[1] = itemdata; |
8730 | 8730 |
8731 tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; | 8731 tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; |
8732 tvi.pszText = UTF8toWide(title); | 8732 tvi.pszText = UTF8toWide(title); |
8733 tvi.lParam = (LONG)ptrs; | 8733 tvi.lParam = (LPARAM)ptrs; |
8734 tvi.cchTextMax = (int)_tcslen(tvi.pszText); | 8734 tvi.cchTextMax = (int)_tcslen(tvi.pszText); |
8735 tvi.iSelectedImage = tvi.iImage = _lookup_icon(handle, (HICON)icon, 1); | 8735 tvi.iSelectedImage = tvi.iImage = _lookup_icon(handle, (HICON)icon, 1); |
8736 | 8736 |
8737 tvins.item = tvi; | 8737 tvins.item = tvi; |
8738 tvins.hParent = parent; | 8738 tvins.hParent = parent; |