Original Post
Well, I''ve managed to waste far too much time trying to sort this stuff out on my own. I''m creating an app in VC++ 6.0 (no MFC), and have the dialog I''d like displayed created fine. As well, I''m adding strings to my combo box using the CB_ADDSTRING message. This seems to work fine, as when I do a SendMessage with CB_SETCURSEL it displays the string in the edit box fine.
Now, my problem: When I click on the drop down arrow, nothing displays. It shows a slight black line underneath the combo box, but none of the items I''ve added.
Can anyone help me with this? I haven''t been able to sort out how to do this from the MSDN site, even after checking all the CB msgs...
Here''s the code from my WM_INITDIALOG handler:
char szTemp [ 32 ], szTemp2 [ 32 ];
HWND ComboBox = GetDlgItem ( hDialog, IDC_HOUR1 );
CenterWindow ( hDialog );
SendMessage ( ComboBox, CB_RESETCONTENT, 0, 0 );
for ( int a = 1; a < 13; a++ )
{
itoa ( a, szTemp, 10 );
strcpy ( szTemp2, szTemp );
strcat ( szTemp2, " AM" );
SendMessage ( ComboBox, CB_INSERTSTRING, a - 1, (LPARAM)szTemp2 );
strcpy ( szTemp2, szTemp );
strcat ( szTemp2, " PM" );
SendMessage ( ComboBox, CB_INSERTSTRING, a + 11, (LPARAM)szTemp2 );
}
SendMessage ( ComboBox, CB_SETCURSEL, 0, NULL );
return ( true );