Solved

Detecting Double Click in CListCtrl

Posted on 1997-07-14
3
443 Views
Last Modified: 2013-11-20
How do you process a double click on a CListCtrl ?

I have added the message map using class wizard, but the  
value returned to the function does not produce meaningful values for the iItem part of the structure. The items in the CListCtrl are numbered 1-5, but the numbers returned in CListCtrl are 100,000 + !!

I am almost at trhe stage of detecting the double click, and then scanning all items to see if they are selected, which is a pretty dumb way to do it.

Thanks.

Glenn Corbett
0
Comment
Question by:gcorbett
3 Comments
 
LVL 4

Accepted Solution

by:
AVaulin earned 100 total points
ID: 1302559
Use:
void CYourListCtrl::OnLButtonDblClk(UINT nFlags, CPoint point)
{
 int i = HitTest( point, &nFlags );
 if( i != -1 )
 {
 // do what you want with list item #i (zero-based)
 }
}
0
 

Expert Comment

by:jasiek
ID: 1302560
Hello,
I do it in another way. If this answer is wrong, I will tell you my way.
Regards,
0
 

Author Comment

by:gcorbett
ID: 1302561
Thanks !!

I will give it a go
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 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

9 Experts available now in Live!

Get 1:1 Help Now