Solved

"Delete" key processing

Posted on 1998-07-06
3
189 Views
Last Modified: 2013-12-03
win 95 vis c++ 4.1 MFC application

I am using a formview containing many buttons and an "input" box. i wish to allow the user to delete an "input box" entry using the delete key...and this works automatically...however, the program does not "receive" the fact of the the "delete" key depression., no matter how i try.
How do i set the formview to receive notification of the delete key?
0
Comment
Question by:rich135
3 Comments
 

Expert Comment

by:deedge
ID: 1409512
I'm not sure if I know what you mean by the fact that is works automatically, but then it doesn't work at all.... But, have you tried to receive the WM_KEYUP message. Then check to see if the input box has the focus, and then check to see which key was pressed. If it was the DEL key (have to look it up in the ASCII table) remove the entry?
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 30 total points
ID: 1409513
The WM_CHAR, WM_KEYDOWN, and WM_KEYUP messages are sent to the edit control itself because it has the input focus. If you want to receive the actual keystroke message, you msut subclass the edit control and handle it yourself.

If you want to know that the edit control has changed its content, look for the EN_CHANGE or EN_UPDATE messages, as appropriate. They're sent from the control to the window that owns the control, so you can simply use ClassWizard to hook up handlers for the messages.

B ekiM
0
 

Author Comment

by:rich135
ID: 1409514
good work , mike. The en change did it.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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