Jump to content
  • Advertisement
Sign in to follow this  
blueshogun96

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

This topic is 2626 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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?

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 );



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
Advertisement
My first guess would be that you need to adjust the expanded size of the control in the resource editor. It won't drop down if it's not big enough. See http://msdn.microsoft.com/en-us/library/4cta1x1t.aspx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!