Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Trapping Enter key in Combobox in Toolbar ?

Posted on 1997-07-25
2
Medium Priority
?
544 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
ajh020797 earned 400 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

721 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