|
-
May 22nd, 1999, 01:58 PM
#1
Drag&Drop CListBox
When I use the LButtonDown for Drag and Drop, The control never recieves a ButtonUp. I made a class from a CListBox, and my code looks like this:
void ListBox::OnLButtonDown(UINT nFlags, CPoint point)
{
COleDataSource* pSource = new COleDataSource();
CSharedFile sf(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT);
CString text = _T("Testing 1... 2... 3...");
sf.Write(text, text.GetLength()); // You can write to the clipboard as you would to any CFile
HGLOBAL hMem = sf.Detach();
if (!hMem) return;
pSource->CacheGlobalData(CF_TEXT, hMem);
pSource->DoDragDrop();
CListBox::OnLButtonDown(nFlags, point);
}
What am I doing wrong?
-
May 22nd, 1999, 08:53 PM
#2
Re: Drag&Drop CListBox
Why you want recevie the WM_LBUTTONUP ?
You can do what you want after the DoDragDrop return.
There is a more detail example in MSDN. Search "Lstdrg.exe".
-
May 25th, 1999, 06:41 AM
#3
try setcapture()
this function redirects all mouse movements to the currently selected control until youy release it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|