Skip to main content
GameDev.net gamedev.net
🔒 Locked

ComboBox Problem ( win32 api, c++ )

Started by MaggoT Mar 4, 2005 at 7:04 AM 1 replies 3.6k views
Original Post
MaggoT
MaggoT
Hello It's like this, i have created 2 combo boxes ( CBS_DROPDOWN ):

hType		= CreateWindowEx(WS_EX_CLIENTEDGE, "COMBOBOX", "", WS_VISIBLE|WS_CHILD|CBS_DROPDOWN, 375, 50, 100, 130, hwnd, (HMENU)IDC_TYPE , GetModuleHandle(NULL), NULL);
hRType		= CreateWindowEx(WS_EX_CLIENTEDGE, "COMBOBOX", "", WS_VISIBLE|WS_CHILD|CBS_DROPDOWN, 375, 185, 100, 130, hwnd, (HMENU)IDC_RTYPE, GetModuleHandle(NULL), NULL);

And initialized them:

SendMessage(hType , CB_ADDSTRING,0, (LPARAM)"1 Byte" );
SendMessage(hType , CB_ADDSTRING,0, (LPARAM)"2 Bytes");
SendMessage(hType , CB_ADDSTRING,0, (LPARAM)"4 Bytes");
SendMessage(hType , CB_ADDSTRING,0, (LPARAM)"6 Bytes");
SendMessage(hType , CB_ADDSTRING,0, (LPARAM)"8 Bytes");

SendMessage(hRType, CB_ADDSTRING,0, (LPARAM)"1 Byte" );
SendMessage(hRType, CB_ADDSTRING,0, (LPARAM)"2 Bytes");
SendMessage(hRType, CB_ADDSTRING,0, (LPARAM)"4 Bytes");
SendMessage(hRType, CB_ADDSTRING,0, (LPARAM)"6 Bytes");
SendMessage(hRType, CB_ADDSTRING,0, (LPARAM)"8 Bytes");

SetWindowText(hType , "6 Bytes");
SetWindowText(hRType, "6 Bytes");

And they work to "drop down", but i can't make a selection with the mouse i can only use the up,down arrows on the keyboard and while the drop down box is "dropped down" i can't do anything with the program before i make a selection with the arrow keys and press enter. It's like the program is "frozen", or not in active at all. So the big problem is, how do i get my dropdown combobox to be able to make a selection with the mouse?
neonkandi
neonkandi
Have you set up an event handler to catch the windows message when the mouse event happens, if not then this is something you will definitely need to do.
MaggoT
MaggoT
You're right, that was what i forgot to do. thank you for the help, it's much appriciated!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.