Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm trying to implement a drag and drop utility in my listbox to interact with other programs, such as notepad++, visual studio, ... in way to drag same text into my listbox and also drag same text from it.

All examples that I found work with files. I want to drag and drop simple text.

Can anyone help me here?

Best regards,
Filipe Marques
Posted

1 solution

When using MFC, you can use the COleDataSource and COleDataObject classes to implement Drag & Drop. The link http://aclacl.brinkster.net/MFC/ch19c.htm[^] provides a good explanantion with examples.

To pass text, you can use global memory data with the CF_TEXT and CF_UNICODETEXT formats.
 
Share this answer
 
Comments
Filipe Marques 26-Sep-13 17:55pm    
Thanks Jochen. You help me. Thats work know ;) Best regards, Filipe Marques

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900