Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!ames!ncar!boulder!pikes!udenva!isis!nbires!matt From: matt@nbires.nbi.com (Matthew Meighan) Newsgroups: comp.windows.ms Subject: Why does SetFocus fail? Keywords: SetFocus Child WM_ACTIVATEAPP Message-ID: <224@nbires.nbi.com> Date: 14 Feb 89 00:40:26 GMT Distribution: na Organization: NBI Inc., Boulder, CO. Lines: 19 I have an app that has a parent window with three child windows. Each of the children's message handling procedures detects when the tab key is pressed and sets the focus to the next of the three. This works fine except when the app loses the focus and then regains it (e.g., if I alt-tab to the dos executive and back). In response to the WM_ACTIVATEAPP message, I call SetFocus with one of the child's handles. However, the child does not get the focus; WM_KEYDOWN messages go to the parent's window, not the child window, despite the SetFocus call. I tried calling SetFocus twice, and looking at its return; it is zero BOTH times -- which would imply that the first SetFocus did not set the focus at all. Anyone know why SetFocus would fail like this? Thanks in advance. -- Matt Meighan "The eighties are the fifties in color." - Cowtown matt@nbires.nbi.com (nbires\!matt)