ho trovato, ma molto macchinoso!
Codice PHP:
//---------------------------------------------------------------------------
LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
const char *ComboBoxItems[] = { "Sri Lanka", "El Salvador", "Botswana",
"France", "Cuba" };
switch(Msg)
{
case WM_INITDIALOG:
hWndComboBox = CreateWindow("COMBOBOX",
NULL,
WS_CHILD | WS_VISIBLE,
60, 62, 136, 60,
hWndDlg,
NULL,
hInst,
NULL);
if( !hWndComboBox )
{
MessageBox(hWndDlg,
"Could not create the combo box",
"Failed Control Creation",
MB_OK);
return FALSE;
}
SendMessage(hWndComboBox,
CB_ADDSTRING,
0,
reinterpret_cast<LPARAM>((LPCTSTR)ComboBoxItems[0]));
SendMessage(hWndComboBox,
CB_ADDSTRING,
0,
reinterpret_cast<LPARAM>((LPCTSTR)ComboBoxItems[1]));
SendMessage(hWndComboBox,
CB_ADDSTRING,
0,
reinterpret_cast<LPARAM>((LPCTSTR)ComboBoxItems[2]));
SendMessage(hWndComboBox,
CB_ADDSTRING,
0,
reinterpret_cast<LPARAM>((LPCTSTR)ComboBoxItems[3]));
SendMessage(hWndComboBox,
CB_ADDSTRING,
0,
reinterpret_cast<LPARAM>((LPCTSTR)ComboBoxItems[4]));
return TRUE;
case WM_COMMAND:
switch(wParam)
{
case IDCANCEL:
EndDialog(hWndDlg, 0);
return TRUE;
}
break;
}
return FALSE;
}
//---------------------------------------------------------------------------