Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!rutgers!mcnc!ncsuvx!news From: kfort@shumv1.ncsu.edu (Ken Fort) Newsgroups: comp.windows.ms Subject: Re: Error checking in Edit boxes. Message-ID: <1990Jul5.043514.7208@ncsuvx.ncsu.edu> Date: 5 Jul 90 04:35:14 GMT References: <118500037@uxa.cso.uiuc.edu> Reply-To: kfort@shumv1.ncsu.edu (Ken Fort) Organization: NCSU Computing Center Lines: 29 In article <118500037@uxa.cso.uiuc.edu> mms00786@uxa.cso.uiuc.edu writes: > >Hello! > >I am in the process of writing a fairly simple dialog box function, and need >some help with that. To make it simple, I'll simplify the dialog box so it >has only one edit box, one other control, an OK button and a Cancel button. >The value in the edit box is constrained. What I want to do is this : if >the user types in an invalid value, I want to emit a beep. Currently, I do >this when I get an EN_KILLFOCUS message from the control. However, I do not >want to beep when the user has either hit the ESC key or pressed the ESC >or Cancel button. How do I know, when I get the EN_KILLFOCUS, whether it is >due to the pressing of the Cancel button or the ESC key? > >(I think that should be WM_KILLFOCUS, but you get the idea). > >Thanks for any input! > >Milan >. Milan, What if you try keying off of WM_CHAR messages instead? Check the value of input from the Edit Control as it comes in through each keystoryke. -- |``````````````````````````````````````````````````````````````````````````| | Ken Fort kfort@shumv1.ncsu.edu N. C. State University | |--------------------------------------------------------------------------|