views:

218

answers:

1

Hi,

In report view in a CListCtrl in MFC, how do I detect if there is no current highlighted selection?

Using GetFirstSelectedItemPosition doesn't work because if an item was previously selected and then clicked somewhere else on the list control, GetFirstSelectedItemPosition still reports the last position selected instead of NULL, however, the said position is not highlighted anymore.

+2  A: 

Did you try CListCtrl::GetSelectedCount?

Dan Breslau
Oh crap, i'll try that, thanks :)
krebstar
Nvm, my problem was that I was losing the focus.. :) Thanks anyway, you answered the question correctly, my question was just phrased incorrectly.. Thanks :D Your answer put me on the right track :)
krebstar