I am trying to populate a Listbox, but the text does not get placed into the box.
I am using Pelles c 7.00.355 64bit
Win7 OS
I have used the Wizard to create a Dialog-based app.
I have used the drag-and-drop interface to place a Listbox icon in my app.
The ID of my Listbox is 4015
I have successfully used:
ShowWindow(GetDlgItem(hwndDlg,4015),SW_HIDE);
and
ShowWindow(GetDlgItem(hwndDlg,4015),SW_SHOW);
to hide and show the dialog, under user control, when app is running.
Here is the code I am using to populate the Listbox - that does not work.
I have included the declarations below.
int pos;
int ii;
HWND hwndList;
char buf22[300];
strcpy(buf22, "some listbox text");
hwndList = GetDlgItem(hwndDlg, 4015);
ii = 1;
pos = (int)SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM) buf22);
SendMessage(hwndList, LB_SETITEMDATA, pos, (LPARAM) ii);
// Set input focus to the list box.
SetFocus(hwndList);
Any help is much appreciated.
Thank-you.