Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello All,

I'm looking to insert data into a Listview on a timed event rather than through a button click. This means that throughout the runtime of the software, rows will be continually added and deleted.

How do I go about doing this? I can add rows when I create the ListView e.g.

C++
LVITEM lvi;
lvi.mask = LVIF_TEXT;
lvi.iItem = 0;
lvi.iSubItem = 0;
lvi.pszText = bob;

ListView_InsertItem(list, &lvi);


But I don't know which windows message handler I would need to put this in if I wanted to update on-the-fly. E.g. does it go in WM_PAINT? WM_NOTIFY? Etc.

I'm using the Win32 listview without MFC.

Thanks in advance!
Posted

1 solution

You can modify the list view from any point within your application when you know the HWND. So store the HWND somewhere and use it from within your timer function.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900