Solved

identifying keystrokes

Posted on 2000-03-12
3
144 Views
Last Modified: 2013-11-20
On my application I have an edit box in which the user enters a string.  I need to be able to tell within the OnChangeEditBox function what the last key the user pressed was, especially whether it was the delete key.

If anyone has any ideas I would be extremely grateful.  Thanks!
0
Comment
Question by:sjhl
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
Wyn earned 80 total points
ID: 2609694
You should subclass CEdit and create a new CMyEdit box or subclass the current CEdit control.
Then map WM_KEYUP to your CMyEdit and save the message value into a global or static variable.
Later , in your OnChangeEditFunction(),you'd check the variable to get what key was just released.


Free to ask.

Regards
W.Yinan
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2609697
Btw:You can also store it in PreTranslateMessage(),first check if it's WM_KEYUP and store it.
0
 
LVL 1

Author Comment

by:sjhl
ID: 2609847
Looks a great way to go about it.
However I found an easier method suitable for my application.

thanks
Sjhl.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

18 Experts available now in Live!

Get 1:1 Help Now