Solved

Trapping Enter key in Combobox in Toolbar ?

Posted on 1997-07-25
2
536 Views
Last Modified: 2013-11-20
I'm trying to trap the enter key in the editbox portion of a combobox located in a toolbar. I've created my own combobox class from CCombobox and added handlers for keyup, keydown and wmchar to no avail. Could anyone advise ?
0
Comment
Question by:johand
2 Comments
 

Accepted Solution

by:
ajh020797 earned 100 total points
ID: 1302797
Try watching the messages that go through PreTranslateMessage, if a WM_CHAR,WM_KEYUP, or WM_KEYDOWN message is sent it will get it before the control has time to filter it out.
0
 

Expert Comment

by:tflex
ID: 1302798
I am using this for all 'Edit' controls in my toolbars

BOOL CMyToolBar::PreTranslateMessage(MSG* pMsg)
  {
  if (pMsg->message == WM_KEYDOWN)
    {
    switch (pMsg->wParam)
      {
      case 27:  //Escape
       .......
      case 13: //Enter
      .......
      }
    }
  return CDialogBar::PreTranslateMessage(pMsg);
  }

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now