adding items to a ListBox does not work
all I want to do is simply add a string to a list box.
When trying to add a string SendMessage() returned 0, but checking the number of list box entries (LB_GETCOUNT) said zero. The item was not added and is hence not displayed in the listbox. Has anyone an explanation for this?
I tried the following code:
HWND hwndList = GetDlgItem(hWnd, IDC_LISTBOX);
SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM) "I am a string");
int numberitems = SendMessage(hwndList, LB_GETCOUNT, 0, 0);
I use the MSVC 6. I created the list box with the built-in resource manager (by simply drag and drop).
Here is the excerpt from the generated .rc file:
CONTROL "List1",IDC_LISTBOX,"SysListView32",LVS_ALIGNLEFT |
WS_BORDER | WS_TABSTOP,69,61,191,91

