• Advertisement
Sign in to follow this  

setFocus()

This topic is 3513 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

according to msdn
The SetFocus function sends a WM_KILLFOCUS message to the window that loses the keyboard focus and a WM_SETFOCUS message to the window that receives the keyboard focus. It also activates either the window that receives the focus or the parent of the window that receives the focus.
My application has a window with a child. And when i move from another application to my app, i receive, a parent WM_SETFOCUS, and then a child WM_SETFOCUS, so im receiving *both*. But the documentation says
It also activates either the window that receives the focus *or* the parent of the window that receives the focus.
But if *I* call this function say, in the childs wndProc as so ...
case WM_MOUSE_LEFT_CLICK:
setFocus(handle_of_this_window);

it only calls the childs WM_SETFOCUS, as the documentation quotes, but what does it mean when it says "or the parent of the window that receives the focus". How is whether the parent or current wndproc determined to be called? , such as howcome in this case it vhose to call the childs wndproc rather than the parents .

Share this post


Link to post
Share on other sites
Advertisement
hmm, i didn't read the post carefully so i am not sure what your asking.

Can it be bc the parent already has the focus that it isnt receiving it again? Does the parent window get it if you click on a dif window then the guiwnd your currently clicking?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement