ms-help://MS.MSDNQTR.2004APR.1033/shellcc/platform/commctls/listview/listview_using.htm
// InitListViewImageLists - creates image lists for a
// list-view control.
// This function only creates image lists. It does not
// insert the items into the control, which is necessary
// for the control to be visible.
// Returns TRUE if successful, or FALSE otherwise.
// hWndListView - handle to the list-view control.
BOOL InitListViewImageLists(HWND hWndListView)
{
HICON hiconItem; // icon for list-view items
HIMAGELIST hLarge; // image list for icon view
HIMAGELIST hSmall; // image list for other views
// Create the full-sized icon image lists.
hLarge = ImageList_Create(GetSystemMetrics(SM_CXICON),
GetSystemMetrics(SM_CYICON), ILC_MASK, 1, 1);
hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON), ILC_MASK, 1, 1);
// Add an icon to each image list.
hiconItem = LoadIcon(g_hinst,
MAKEINTRESOURCE(IDI_ITEM));
ImageList_AddIcon(hLarge, hiconItem);
ImageList_AddIcon(hSmall, hiconItem);
DestroyIcon(hiconItem);
/******************************************************
Usually you have multiple icons; therefore, the previous
four lines of code can be inside a loop. The following
code shows such a loop. The icons are defined in the
application's header file as resources, which are
numbered consecutively starting with IDS_FIRSTICON. The
number of icons is defined in the header file as
C_ICONS.
for(index = 0; index < C_ICONS; index++)
{
hIconItem = LoadIcon (hInst, MAKEINTRESOURCE
(IDS_FIRSTICON + index));
ImageList_AddIcon(hSmall, hIconItem);
ImageList_AddIcon(hLarge, hIconItem);
Destroy(hIconItem);
}
*******************************************************/
// Assign the image lists to the list-view control.
ListView_SetImageList(hwndLV, hLarge, LVSIL_NORMAL);
ListView_SetImageList(hwndLV, hSmall, LVSIL_SMALL);
return TRUE;
}
дальше думаю понятно