实现拖拽并有缩略图。在2000正常,XP一片黑。
我在2000下实现的文件拖拽,主要用
ON_NOTIFY(LVN_BEGINDRAG, IDC_LIST_FILELIST, OnBegindragListFilelist)
ON_WM_MOUSEMOVE()
ON_WM_LBUTTONUP()
这三个消息。在OnBegindragListFilelist中实现缩略图创建。
static CBitmap* bm = NULL;
if(bm!=NULL)
delete bm;
bm = CreateDragThumb();
int nRes = m_ilDrag.Add( bm, bm); // 添加到CImageList中
m_ilDrag.BeginDrag( 0, CPoint(nOffset, nOffset - 4));
m_ilDrag.DragEnter( GetDesktopWindow(), pNMListView->ptAction);
m_bDragging = TRUE; //we are in a drag and drop operation
SetCapture ();
在OnMouseMove中实现:移动。
m_ilDrag.DragMove(pt); //move the drag image to those coordinates
可是上述代码在2000中没有问题,到了XP。就是一块黑图。。不知谁知道是怎么回事?
谢谢