Problems setting selection in listview window

This is a discussion on Problems setting selection in listview window within the Windows Programming forums, part of the Platform Specific Boards category; I'm trying to manually select a row in my listview using ListView_SetSelectionMark but nothing is happening. My code constantly updates ...

Problems setting selection in listview window

I'm trying to manually select a row in my listview using ListView_SetSelectionMark but nothing is happening. My code constantly updates the listview from a process queue, and to do this I simply delete all items and repopulate. Problem is, it appears that the selection value for the listview is staying, but the row doesn't highlight. Is there another function I need to call to actually highlight? Here is the relevant code:

Along the same lines, I want the user to be able to delete an item by pressing the delete key. Problem is, when the user clicks somewhere in the listview my main window loses focus and isn't able to trap the VK_DELETE message. Whats an easy way around this or do I have to declare a process for the listview child window?

Last edited by PJYelton; 04-11-2005 at 10:16 PM.
Reason: added another quick question