retrieving data from listboxes
hello,
i'm working on a small app with a listbox, and i'm looking for a way to display the users selection. It's a dialog application, and i'm using a single-selection listbox.
I've tried this, but without success:
Code:
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_LIST:
switch(HIWORD(wParam))
{
case LBN_SELCHANGE:
LRESULT selection = SendMessage(hWnd, LB_GETTEXT, 0, 0);
SetDlgItemText(hWnd, IDC_TEXT, (LPCSTR)selection);
break;
}
break;
}
break;
Any ideas what i'm doing wrong?