Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the show of the ListCtrl report style screen, I want to get the informations of any row which I click or double clicking.

Someone advised me to use tictest of ListCtrl, I can see very rare examples about it.
Directly speaking, When I clicked the screen of ListCtrl, I want to know the position of mouse, name,age, addresses of one record informations including the row index and column sequences.

Thank you

What I have tried:

This is very long suffering of my projects. One key may solve many locks.
Posted
Updated 30-Mar-16 0:03am

1 solution

Handle the NM_CLICK (list view) notification code (Windows)[^] and NM_DBLCLK (list view) notification code (Windows)[^] notification messages in your parent window.

The LPARAM parameter for these messages is a pointer to a NMITEMACTIVATE structure (Windows)[^] containing all necessary information (clicked row index, mouse position).

If you also need the column index where the click occured, send a LVM_SUBITEMHITTEST message (Windows)[^] to the list control.

The content of the columns can then be simply retrieved by accessing the list control items.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900