CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    74

    Anyone tell me how a CComboBox can capture a WM_CHAR ?

    I derived MyComboBx from CComboBox and added a message map entry to catch a WM_CHAR, the resulting function never gets called . . . (?) Appreciate any input from you experts. Thanks! JD


  2. #2
    Join Date
    May 1999
    Posts
    42

    Re: Anyone tell me how a CComboBox can capture a WM_CHAR ?

    Create a variable for tracking when the combo box has focus. Let's call it m_bFocus.

    Map messages for CBN_SETFOCUS and CBN_KILLFOCUS. In the SetFocus handler, set m_bFocus to true; in the KillFocus handler, set m_bFocus to false.

    Map PreTranslateMessage and in that function, place code like the following:

    if(pMsg->message == WM_CHAR && m_bFocus)
    {
    // do soemthing now that you have the char
    }



  3. #3
    Join Date
    Apr 1999
    Posts
    74

    Bob, Thanks alot! eom

    eom



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured