From 5a8b6748f6b0a2c63f9880cce6b115d2382430f7 Mon Sep 17 00:00:00 2001 From: sweaty1 Date: Mon, 14 Sep 2009 09:08:51 +0000 Subject: [PATCH] Added support for OLE drag drop (Fixed drag over highlight in vista) --- CGridListCtrlEx/CGridListCtrlEx.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CGridListCtrlEx/CGridListCtrlEx.cpp b/CGridListCtrlEx/CGridListCtrlEx.cpp index d35c4937..874545b2 100644 --- a/CGridListCtrlEx/CGridListCtrlEx.cpp +++ b/CGridListCtrlEx/CGridListCtrlEx.cpp @@ -1853,7 +1853,10 @@ bool CGridListCtrlEx::OnDisplayRowFont(int nRow, LOGFONT& font) void CGridListCtrlEx::OnDisplayDragOverRow(int nRow) { if (UsingVisualStyle()) + { + SetHotItem(nRow); return; + } SetItemState(-1, 0, LVIS_DROPHILITED | LVIS_FOCUSED); SetHotItem(-1); @@ -3084,7 +3087,7 @@ namespace { // If both selected then no change in positioning if (selected1 && selected2) - return lParam1 - lParam2; + return (int)(lParam1 - lParam2); else if (selected1) { @@ -3115,7 +3118,7 @@ namespace { if (ps.m_nRow < lParam2) return 1; // Place selected items before drop-row else - return -1; // Place selected items after drop-row } + return -1; // Place selected items after drop-row } else if (lParam1 > ps.m_nRow) @@ -3124,7 +3127,7 @@ namespace { return -1; } // If none selected then no change in positioning - return lParam1 - lParam2; + return (int)(lParam1 - lParam2); } }