Jump to content
  • Advertisement
Sign in to follow this  
kingpinzs

help on notification in a drop down combo box[solved]

This topic is 4857 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

I have made a drop down combo box and populated it with strings. Now I am trying to be able to detect if some one has clicked on a item or not. this is what I have done
case WM_COMMAND:
	   {
switch (wParam)
		{
               case ComboList:
                    {
                     if(HIWORD(wParam)== CBN_SELENDOK)
                      {                             
                  
     MessageBox(hwnd,"boy","Error",0);
                      
                                   }
                                   }break;



It does not pop uo with the messagebox when a iteam is clicked Any one know why it wont? [Edited by - kingpinzs on December 5, 2005 10:40:20 AM]

Share this post


Link to post
Share on other sites
Advertisement
kingpinz,

Where are you handling the WM_COMMAND? Also, if you have the pointer to the actual combo box I recommend that you determine whether or not anything has been selected by 'HIWORD (wParam) == CBN_SELENDOK' and by comparing the HWND to the combo box and the lParam value.

-brad

Share this post


Link to post
Share on other sites
WM_COMMAND is handled by

LRESULT CALLBACK TheWindowProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{

ComboList is the ID.

How would I do this?
"
I recommend that you determine whether or not anything has been selected by 'HIWORD (wParam) == CBN_SELENDOK' and by comparing the HWND to the combo box and the lParam value."


Share this post


Link to post
Share on other sites
Try like this:


case WM_COMMAND:
{
switch ( LOWORD( wParam ) )
{
case ComboList:
{
if( HIWORD( wParam ) == CBN_SELENDOK )
{
MessageBox(hwnd,"boy","Error",0);
}
}
break;
}
}


If this doesn't show the MessageBox on selection of a valid item in the listbox somethings wrong with the parent/child-relationship.

Share this post


Link to post
Share on other sites
now I get warning unreachable code at beginning of switch statement.
Not sure what that means. And it still does not work. So I think it is saying that the switch statment is invalid.

scratch that It works I just had to move some code around.

Thanks for everyu ones help That is exactley what I need to know.

Thanks again to every ones help

[Edited by - kingpinzs on December 5, 2005 10:06:05 AM]

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!