ehm.. i haven't thought about that
i'm pretty new to this API programming, but i've tried to do as you said, but it still dosen't work . here's the new code:
Code:
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_LIST:
switch(HIWORD(wParam))
{
case LBN_SELCHANGE:
HWND hList = GetDlgItem(hWnd, IDC_LIST);
char* buf;
LRESULT len = SendMessage(hList, LB_GETTEXTLEN, 0, 0);
buf = (char*)GlobalAlloc(GPTR, len+1);
SendMessage(hList, LB_GETTEXT, 0, (LPARAM)buf);
SetDlgItemText(hWnd, IDC_TEXT, buf);
GlobalFree((HANDLE)buf);
break;
}
break;
}
break;