473,799 Members | 3,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_L ist,
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::OnM ouseMove(UINT nFlags, CPoint point) {
if (m_draging) {
LVHITTESTINFO lvHTI;
lvHTI.pt = point;
SubItemHitTest( &lvHTI);
if (lvHTI.flags & LVHT_ONITEMLABE L) {
if (m_posItemDrop != lvHTI.iItem) {
m_dragImage->DragShowNolock (FALSE);
// old item
SetItemState(m_ posItemDrop, 0, LVIS_DROPHILITE D);
m_posItemDrop = lvHTI.iItem;
// SetHotItem(m_po sItemDrop);
SetItemState(m_ posItemDrop, LVIS_DROPHILITE D,
LVIS_DROPHILITE D);
RedrawWindow();
// RedrawItems(0, GetItemCount()) ;
m_dragImage->DragShowNolock (TRUE);
//Update(lvHTI.iI tem);
}
}
// move image being dragged
m_dragImage->DragMove(point );
}
CListCtrl::OnMo useMove(nFlags, point);
}

Nov 17 '05 #1
0 1937

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

Similar topics

0
2607
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 simutate it. Can anyone help? Thanks ************************** previous post: Message 1 in thread
2
4337
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 there? What about Drag/Drop; is there more than one way for the source to make data available Is it always OLE?
3
10420
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== using System; using System.Drawing; using System.Collections; using System.ComponentModel;
0
632
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 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
0
2277
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 CListCtrl list; This compiles fine. But now I try to invoke a function list.SetView(0). The compiler says : 'SetView' is not a member of the CListCtrl. I inquired into the afxcmn.h and found that this function is only
6
3562
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 where the user can run on firefox/mozilla, what would be a good approach. 1. Should I overwrite the javascript code drag-and-drop to make it more browser independent. If I want to go this route, can anybody provide me a
3
10600
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
1
4716
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 I drop onto the shell I want a file created with a specified name containing the data from the database. I've looked at the FileDrop format but it look to have only the filename and not the data. TIA
5
13814
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 drag&drop on the same page (which was not possible). Now i´ve a new concept of the script, more object oriented. I´ve also commented the whole code so you guys can easier understand it engine. What exactly we need when trying to make a column drag &...
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10029
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.