This is the code for the ListView creation:
Code:
CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, NULL, WS_CHILD|WS_VISIBLE|LVS_REPORT|LVS_NOCOLUMNHEADER|LVS_SINGLESEL, 0, 0, 0, 0, hwndParent, HMENU(iID), hInstance, 0);
This is my code to add the items:
Code:
void LogMessage(HWND g_hwndList, const char *pStr)
{
LVITEM item = {0};
item.mask = LVIF_TEXT;
item.pszText = (char *)pStr;
item.cchTextMax = strlen(pStr);
item.iItem = SendMessage(g_hwndList, LVM_GETITEMCOUNT, 0, 0);
ListView_InsertItem(g_hwndList, &item);
ListView_EnsureVisible(g_hwndList, item.iItem, 0);
return;
}
So there's a button that adds the strings into the listview:
Code:
LogMessage(hListView1, "Joel");
The listview shows correctly and I want it to emulate a listbox control...but the strings are not visible...any ideas?