Help with adding strings into ComboBox using Window Handle
I have no idea what's wrong with my code, please help!
Code:
BOOL CALLBACK FileDlgProc(HWND hwnd2, UINT Message, WPARAM wParam, LPARAM lParam){
switch(Message){
case WM_CREATE:{
HWND handle;
LRESULT l;
handle = NULL;
handle = GetDlgItem(hwnd2, ID_S_C);
if (handle == NULL){
MessageBox(hwnd2, "handle == NULL", "........", MB_OK);
}
l = SendMessage(handle, CB_ADDSTRING, (WPARAM) 0, (LPARAM) "Name");
l = SendMessage(handle, WM_SETTEXT, (WPARAM) 0, (LPARAM) "Name");
l = SendMessage(handle, CB_ADDSTRING, 0, (LPARAM) "Telephone");
l = SendMessage(handle, CB_ADDSTRING, 0, (LPARAM) "Email");
}
break;
... //omitted
}
...//omitted
}
Assuming my control id is correct, can anyone help by telling me what's wrong with this? I just couldn't get this to work......
Thanks in advance.