Handling NM_RETURN in a List View

  • Follow


Hi all-

I have created a OWNER_DATA list view using the REPORT view that works
real well.  I can click on an item and get a NM_DBLCLK message and
then get the index of the item that was clicked.

My problem is handling NM_RETURN messages.  If the user single-clicks
on an item, then moves up or down with the cursor, then presses ENTER,
I get the NM_RETURN message, but I don't know how to get the index of
the currently highlighted item.  Can someone help me with this?

Also, is there a way (I'm sure there is) to Set / Highlight a specific
item?  This would be in response to a query entry somewhere else.

Thanks,

Jeff
0
Reply jeff 3/4/2010 3:55:42 AM

<jeff@automationservicesco.com> wrote:

> My problem is handling NM_RETURN messages.  If the user single-clicks
> on an item, then moves up or down with the cursor, then presses ENTER,
> I get the NM_RETURN message, but I don't know how to get the index of
> the currently highlighted item.  Can someone help me with this?

The lParam of the NM_RETURN notification points to a NMLISTVIEW structure 
that contains the index of the item.

> Also, is there a way (I'm sure there is) to Set / Highlight a specific
> item?  This would be in response to a query entry somewhere else.

Use LVM_SETITEM and set/clear the LVIS_SELECTED flag in the LV_ITEM 
structure. 

0
Reply Preben 3/5/2010 3:17:15 PM


1 Replies
272 Views

(page loaded in 0.026 seconds)

Similiar Articles:













7/27/2012 2:51:27 PM


Reply: