1.SetFocus另外一个控件
GetDlgItem(另一个控件名)->SetFocus();
2.给要失去焦点的控件发WM_KILLFOCUS消息
GetDlgItem(要失去焦点的控件名)->PostMessage(WM_KILLFOCUS, 0, 0);
::SendMessage(GetDlgItem(要失去焦点的控件名)-> m_hWnd,WM_KILLFOCUS,-1,0);
SendDlgItemMessage(要失去焦点的控件名,WM_KILLFOCUS,0,0);
GetDlgItem(另一个控件名)->SetFocus();
2.给要失去焦点的控件发WM_KILLFOCUS消息
GetDlgItem(要失去焦点的控件名)->PostMessage(WM_KILLFOCUS, 0, 0);
::SendMessage(GetDlgItem(要失去焦点的控件名)-> m_hWnd,WM_KILLFOCUS,-1,0);
SendDlgItemMessage(要失去焦点的控件名,WM_KILLFOCUS,0,0);
来源:CSDN
作者:杨家超
链接:https://blog.csdn.net/u014260855/article/details/32916925