Solved

Detecting Double Click in CListCtrl

Posted on 1997-07-14
3
452 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 Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 49
xyBalance chalenge 58 96
maxBlock challenge 30 142
has77  challenge 9 90
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 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