Sign in to follow this  
blueshogun96

Combo Box refuses to work (C/C++, not MFC).

Recommended Posts

Sorry if the solution to this is simple, but I've searched and experimented for hours and hours and can't get this to work to save my life. I've been trying to add this combo box for use in things like display move/monitor enumeration for my project (I hate being forced to default to the primary display adapter), and this combo box is a real pain. Now, I did get the list elements to be added into the box, but the list won't show up when I click it. I can scroll though it using the arrow keys, but that's about it. I have absolutely no idea why this refuses to work. I wrote a little test code to make sure it works (called at WM_INITDIALOG). Did I do anything wrong here?

[code]SendDlgItemMessage( hWnd, IDC_COMBO1, CB_RESETCONTENT, 0, 0 );
SendDlgItemMessage( hWnd, IDC_COMBO1, CB_SHOWDROPDOWN, TRUE, 0 );
SendDlgItemMessage( hWnd, IDC_COMBO1, CB_ADDSTRING, 0, (LPARAM) "Primary Display Driver" );
SendDlgItemMessage( hWnd, IDC_COMBO1, CB_ADDSTRING, 0, (LPARAM) "3Dfx Voodoo3" );
SendDlgItemMessage( hWnd, IDC_COMBO1, CB_ADDSTRING, 0, (LPARAM) "NVIDIA Riva128" );
SendDlgItemMessage( hWnd, IDC_COMBO1, CB_ADDSTRING, 0, (LPARAM) "ATI Radeon 7500" );
SendDlgItemMessage( hWnd, IDC_COMBO1, CB_ADDSTRING, 0, (LPARAM) "Hercules Kyro II" );
SendDlgItemMessage( hWnd, IDC_COMBO1, CB_ADDSTRING, 0, (LPARAM) "Matrox G400" );
SendDlgItemMessage( hWnd, IDC_COMBO1, CB_SETCURSEL, 0, 0 );[/code]


Of course, don't take those card names too seriously here, it's just a test. So what do you think I'm doing wrong here? This sucks. Any ideas? Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this