Click to See Complete Forum and Search --> : Getting list of selected items from a list control


April 21st, 1999, 06:36 AM
Hi,
I want to get a list of selected items from a listcontrol.
How do i get it?

Also How do I trap the SHIFT key press and the left button click together.
Please help me out of this.
Thanks

April 21st, 1999, 06:50 AM
To know the items selected in a list you can use the methods GetSelectedCount, GetFirstSelectedItemPosition and GetNextSelectedItem methods of the CListCtrl objects.
If you can not do this then you have to verify the state of each item of the list.

Concerning the shift key and the left click first catch the message WM_LBUTTONDOWN and use the function GetKeyState to see if shift is pressed.

For example :

(GetKeyState(VK_SHIFT) & ~1) is non zero if shift is pressed.