Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!unido!rwthinf!slcdec!hippo!f1.n6000.z2.fidonet.org!p4.f36.n245.z2.fidonet.org!Norbert_Unterberg From: Norbert_Unterberg@p4.f36.n245.z2.fidonet.org (Norbert Unterberg) Newsgroups: comp.windows.ms.programmer Subject: Re: Can I use EN_KILLFOCUS for field-checking? Message-ID: <1569357096@p4.f36.n245.z2.fidonet.org> Date: 27 May 91 09:33:00 GMT References: <7203@p1.f6.n242.z2.fidonet.org> Reply-To: Norbert_Unterberg%p4.f36.n245.z2@hippo.dfv.rwth-aachen.de (Norbert Unterberg) Organization: Point of SoftStream, Dortmund, Germany Lines: 17 Comment-To: Paul_Bonneau@f1.n6000.z2.fidonet.org (Paul Bonneau) > > > >MessageBeep(0); > >SetFocus(hwndCtrl); > >SendDlgItemMessage(hDlg, nCtrlID, EN_SETSEL, 0, MAKELONG(0,32767)); > > > The problem is that you are trying the set the focus back on > a kill focus notification. SetFocus() is *not* reentrant, and > things will get truly screwed up. You can use this way of checking, but you must replace thwe GetFocus(...) with PostMessage(hDlg, WM_NEXTDLGCTL, GetDlgItem(hDlg, nCtrlID), (LONG)TRUE); Norbert Dortmund, Germany