Solved

Trapping Enter key in Combobox in Toolbar ?

Posted on 1997-07-25
2
537 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 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

24 Experts available now in Live!

Get 1:1 Help Now