Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcrware!pgthor!dev386!beckman From: beckman@dev386.UUCP (Zacharias Beckman) Newsgroups: comp.windows.ms Subject: Re: Why does SetFocus fail? Summary: Why SetFocus() may fail... Keywords: SetFocus Child WM_ACTIVATEAPP Message-ID: <437@dev386.UUCP> Date: 15 Feb 89 16:41:59 GMT References: <224@nbires.nbi.com> Distribution: na Organization: University of Iowa, Iowa City Lines: 17 In article <224@nbires.nbi.com>, matt@nbires.nbi.com (Matthew Meighan) writes: > 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. One possible cause is that the child windows are not yet ready to receive the focus (for instance, they have not been created or brought to the top; I do not believe you can give the focus to a window that is covered). Perhaps you could try using PostMessage() to send a message which you define to the child window; when it receives the message, it should then do a SetFocus() on itself. Hope this helps (your problems are reminiscent of a dialog box problem we had some time ago). Zacharias J. Beckman ... gatech!mdt!pgthor!dev386!beckman ... uunet!mcrware!pgthor!dev386!beckman (319) 354-5116 (319) 351-1993 If God had intended Man to Walk, He would have given him Feet.