MFC消息示例
#define VER_SET_FOCUS WM_USER + 100
ON_MESSAGE(VER_SET_FOCUS, &CWriteSnDlg::OnSetFocus)
protected:
afx_msg LRESULT OnSetFocus(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT CCVersionCompareOnlyDlg::OnVerSetFocus(WPARAM wParam, LPARAM lParam)
{
thisDlg->GetDlgItem(IDC_EDIT_BTMAC)->SetFocus();
return 0;
}
SendMessage(VER_SET_FOCUS);