ComboBox problem

Hi all, I have one problem with ComboBox, when I call function like this in

int getCurent = 0;
case WM_CREATE:
SendMessage(CB, CB_SETCURSEL, 3, 0);
getCurent = SendMessage(CB, CB_GETCURSEL, 0, 0);

everithing is ok for getCurent I got 3, but how I can get information of curent selected item out of create message, I tried in WM_COMMAND:
case WM_COMMAND:
switch LOWORD(wParam)
{
case IDCOMBOBOX:
switch HIWORD(wParam)
{
case CBN_SELENDOK:
getCurent = SendMessage(CB, CB_GETCURSEL, NULL, NULL) ;
wsprintf(b, "Index: %i", getCurent);
MessageBox(hwnd, b, "info", MB_OK);
return 0;
}
return 0;
}
But like getCurent value I always get a 0, why ?
[751 byte] By [sucur] at [2007-11-19 19:40:58]
# 1 Re: ComboBox problem
The code is alright. Maybe you have only one item in the combo box? Or maybe you are selecting the first item only.
logan at 2007-11-9 13:20:20 >
# 2 Re: ComboBox problem
No, I have 7 items, and I simple with mouse choose randomly, but all time a getCurent is 0.
If you want I can give you a source to proof. I using MSVS2003NET
why ?
sucur at 2007-11-9 13:21:20 >
# 3 Re: ComboBox problem
Ej I founded mistake, very bad mistake, hard to see, I created HWND of ComboBox in WM_CREATE, why ? I don't know, less concetration in that moment.
poz.
sucur at 2007-11-9 13:22:19 >