Solved

Drag&Drop in CListCtrl

Posted on 1997-11-30
1
684 Views
Last Modified: 2013-11-20
I am implementing a drag&drop for items in a ClistCtrl, as per MFCDrag sample. Everything works fine until I change the style of my ClistCtrl to OwnerDraw. From that point on, the CreateDragImage function creates a drag image only for the icon and not for the text label. Where is the trick?
0
Comment
Question by:winmeister
1 Comment
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1311117
The default wndproc for the list control can create the drag image for your items because it knows how to draw the text. But if your control is owner-drawn, then the default handler cannot possibly know how to draw your items. The only thing it does know how to draw is the icon (bitmaps). So you are in charge of drawing the drag items yourself. It isn't too hard because if you already have the ownerdrawn code, then you just need to create an imagelist and create the image you want to draw and use that image list for the dragging code.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Smart Camera scanning and reading information 3 100
twoTwo  challenge 35 93
Execute multiple curl cmds with sleep and send output to file 10 89
wordappend challenge 8 147
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now