473,395 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Drag and Drop with CListCtrl??

Here is something I find unusual.

I implemented Drag and Drop to CListCtrl.
First I created my own class myCListCtrl from CListCtrl.
I implemented OnMouseMove and OnLButtonUp message handlers in class.

Unusual :
If I don't use RedrawWindow() I get trails from m_dragImage.
and second thing is
I don't need to use DragShowNolock(FALSE) and DragShowNolock(TRUE) to
update window. If I comment these two lines it will work fine.
Of course in parent class i called dragImage->DragEnter(&m_List,
pNMLV->ptAction);
Where m_List is member of CDialog class of type myCListCtrl.

Any comments are appreciated.

Thx, Rajko.

Here is my code:

void myListCtrl::OnMouseMove(UINT nFlags, CPoint point) {
if (m_draging) {
LVHITTESTINFO lvHTI;
lvHTI.pt = point;
SubItemHitTest(&lvHTI);
if (lvHTI.flags & LVHT_ONITEMLABEL) {
if (m_posItemDrop != lvHTI.iItem) {
m_dragImage->DragShowNolock(FALSE);
// old item
SetItemState(m_posItemDrop, 0, LVIS_DROPHILITED);
m_posItemDrop = lvHTI.iItem;
// SetHotItem(m_posItemDrop);
SetItemState(m_posItemDrop, LVIS_DROPHILITED,
LVIS_DROPHILITED);
RedrawWindow();
// RedrawItems(0, GetItemCount());
m_dragImage->DragShowNolock(TRUE);
//Update(lvHTI.iItem);
}
}
// move image being dragged
m_dragImage->DragMove(point);
}
CListCtrl::OnMouseMove(nFlags, point);
}

Nov 17 '05 #1
0 1907

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lauren Quantrell | last post by:
I'm trying to drop a file from Windows Explorer (or desktop, etc.) onto a field in Access2K and capture the full file path. I found an posting below that says this is possible but I cannot...
2
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put...
3
by: Ajay Krishnan Thampi | last post by:
I have a slight problem implementing 'drag and drop' from a datagrid to a tree-view. I have pasted my code below. Someone please advice me on what to do...pretty blur right now. ==code== ...
0
by: Rajko | last post by:
Here is something I find unusual. I implemented Drag and Drop to CListCtrl. First I created my own class myCListCtrl from CListCtrl. I implemented OnMouseMove and OnLButtonUp message handlers...
0
by: Victor | last post by:
Hi everybody! VS.NET 2003 C++ MFC project for Windows XP I would like to use a CListCtrl control in a dialog. So I have #include'd "afxcmn.h" in my CMyDialog.h and declared a variable...
6
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product...
3
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
1
by: Darren | last post by:
I'm trying to create a file using drag and drop. I want to be able to select a listview item drag it to the shell and create a file. Each icon in the listview represents a blob in a database. When...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.