Link to home
Start Free TrialLog in
Avatar of jejob007
jejob007

asked on

Handling double click event on items in CListCtrl

I am doing a poject in Win32 App that uses CListCtrl class.I want to know how to handle the double click event on items and know which item the user clicked on. Also when the user double clicks the item I want to open a note pad window that displays details of the clicked item. Please tell me what message map/message handler I should add to achieve this.

Thanks

Jejo
Avatar of NeoEGM
NeoEGM
Flag of Argentina image

Hi Jejo, the message you have to handle to accomplish this is the NB_DBLCLK...

For you to know what item is selected you just have to call: pListCtrl->GetSelectionMark();

Then you can call pListCtrl->GetItemText(pListCtrl->GetSelectionMark(), nSubItemToQuery) to get the corresponding text for each column...

Then you can output it to a text file and open it using:

ShellExecuteA(NULL, "open", pszFileNamePath, NULL, NULL, SW_SHOW);


Hope it helps...

Regards,
NeoEGM
Avatar of jejob007
jejob007

ASKER

Hi NeoEGM thanks for your valuable comment.

Selecting items and opening file works fine but still can you please elaborate more on the NB_DBCLK message.How do I handle this message.What function do  I write and what should I write in declare message map area.

Thanks

Jejo
ASKER CERTIFIED SOLUTION
Avatar of NeoEGM
NeoEGM
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial