Thread: Combo Box Problem

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    215

    Combo Box Problem

    Im working on a problem with the combo box, and when i click an item in the combo box i want it to do something. Say i click the second item in the combo box, i want the program to disable some items. but i dont know how to put this in the wm_command statement. this is what i have right now:
    switch(LOWORD(wParam)){
    case ID_COMBO_BOX:
    {

    switch((HIWORD(wParam)))
    {



    }



    }

    break;

    }

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Please use code tags.
    Code:
    case WM_COMMAND:
      {
      HWND hCntrl;
      WORD wId,wNotifyCode;
      
      hCntrl=(HWND)lParam;
      wId=LOWORD(wParam);         /*cntrl id*/
      wNotifyCode=HIWORD(wParam); /*notification msg*/
      
      if (hCntrl && wNotifyCode==BN_CLICKED)
        {
        /*all button control 'click' msgs trapped*/
        /*differentiate between buttons using id*/
        switch (wID)
          {
          case ID_COMBO_BOX:
            /*do stuff*/
            break;
          }
        }
      }
    This information is detailed in the msdn description for WM_COMMAND and BN_CLICKED. You should probably read up on button controls, too.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Create new combo boxes based on items selected in preview combo box
    By RealityFusion in forum Windows Programming
    Replies: 2
    Last Post: 01-10-2007, 09:50 AM
  2. Getting index of chosen item in the combo box
    By what3v3r in forum Windows Programming
    Replies: 4
    Last Post: 09-01-2006, 11:49 AM
  3. I can't init that combo box!
    By Gravedigga in forum Windows Programming
    Replies: 10
    Last Post: 10-06-2003, 04:44 AM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. Ihave a problem with an EDIT box..
    By SyntaxBubble in forum Windows Programming
    Replies: 1
    Last Post: 10-30-2001, 09:25 AM