Sign in to follow this  
maya18222

setFocus()

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this