How can I kill a focus, of a control?
Thanks
How can I kill a focus, of a control?
Thanks
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
One solution is send a WM_KILLFOCUS message to the control.
SendMessage(hControl, WM_KILLFOCUS, 0);
Kuphryn
Another would be to use SetFocus() to set the focus somewhere else.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
What I have is: editbox that I sent text to, and a button. the thing is that when the dialog is called, the text in the editbox is marked, so I did try to set the focus on the button, but no luck.
The WM_KILLFOCUS doesn't work either
Last edited by Devil Panther; 07-25-2003 at 12:25 PM.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
WM_KILLFOCUS is a notification message sent to a window immediately before it loses focus... it doesn't CAUSE it to lose focus. To make something lose focus, tell something else to gain focus via SetFocus(), so the OS knows what to give the focus to. It will then automatically make the control currently in focus lose it, and send it a notification (WM_KILLFOCUS), just in case you need to do something when it no longer has focus.