views:

96

answers:

0

There is SysListView32 control.I am trying to get the no of elements in ListView by using API

int iCount = SendMessage(hList,LVM_GETITEMCOUNT,0,0);

LVM_GETITEMCOUNT returns the no of items properly on XP.

But the same call working intermittently on VISTA. On Vista I am getting iCount =0; GetLastError() on vista returns 0x05.Access denied.

How ever itemcount is returned while debugging since the process is launched with admin privileges

Any suggestios how to make this call work on VISTA?