Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!uunet!math.fu-berlin.de!unido!rwthinf!slcdec!hippo!f1.n6000.z2.fidonet.org!p27.f30.n147.z1.fidonet.org!Gary_Capps From: Gary_Capps@p27.f30.n147.z1.fidonet.org (Gary Capps) Newsgroups: comp.windows.ms.programmer Subject: Can I use EN_KILLFOCUS for field-checking? Message-ID: Date: 29 May 91 22:00:43 GMT Article-I.D.: f1.funpack118015 Reply-To: Gary_Capps%p27.f30.n147.z1@hippo.dfv.rwth-aachen.de (Gary Capps) Organization: "Fribbit me thud, crash, and mumble" -- Norman, OK Lines: 31 Comment-To: Joel_Garrett@f1.n6000.z2.fidonet.org (Joel Garrett) In a message of <23 May 91 15:36:06> Joel Garrett wrote to All: JG>tried using the EN_KILLFOCUS message to let me know when the user was JG>leaving a certain input field, at which time I could check the contents of that JG>field and if they weren't ok, I'd do somthing like this: JG> JG>MessageBeep(0); JG>SetFocus(hwndCtrl); JG>SendDlgItemMessage(hDlg, nCtrlID, EN_SETSEL, 0, MAKELONG(0,32767)); JG> ... JG>When I try doing this, the above section of code seems to get executed JG>Ok, but then it looks as though things get confused, as if I try to tab out of JG>an invalid field, the beep and selection take place but then the input focus JG>seems to go to the next field in the tab order, but things act screwey with JG>regard to how the cursor tracks in the fields, it almost seems as though both You should use PostMessage(hDlg, WM_NEXTDLGCTL, GetDlgItem(hDlg, nCtrlID), TRUE); instead of SetFocus(); gc