Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!mms00786 From: mms00786@uxa.cso.uiuc.edu Newsgroups: comp.windows.ms Subject: Error checking in Edit boxes. Message-ID: <118500037@uxa.cso.uiuc.edu> Date: 3 Jul 90 20:46:00 GMT Lines: 19 Nf-ID: #N:uxa.cso.uiuc.edu:118500037:000:762 Nf-From: uxa.cso.uiuc.edu!mms00786 Jul 3 15:46:00 1990 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 .