Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/147.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 点击Escape与Enter在CListCtrl中触发LVN_ENDLABELEDIT_C++_Mfc_Listbox_Clistctrl - Fatal编程技术网

C++ 点击Escape与Enter在CListCtrl中触发LVN_ENDLABELEDIT

C++ 点击Escape与Enter在CListCtrl中触发LVN_ENDLABELEDIT,c++,mfc,listbox,clistctrl,C++,Mfc,Listbox,Clistctrl,当两种情况下编辑字段均为空时,如何区分这两种情况? 当用户点击escape时,我假设用户根本不想要新值,当 如果按enter键,我假设用户希望编辑的项目有一个空字符串 BEGIN_MESSAGE_MAP(CMyPropertyPage, CPropertyPage) //{{AFX_MSG_MAP(CMyPropertyPage) ON_NOTIFY(LVN_ENDLABELEDIT, IDC_LIST_CONTROL, OnEndLabelEdit) //}}AFX_MSG_MAP E

当两种情况下编辑字段均为空时,如何区分这两种情况?
当用户点击escape时,我假设用户根本不想要新值,当
如果按enter键,我假设用户希望编辑的项目有一个空字符串

BEGIN_MESSAGE_MAP(CMyPropertyPage, CPropertyPage)
//{{AFX_MSG_MAP(CMyPropertyPage)
    ON_NOTIFY(LVN_ENDLABELEDIT, IDC_LIST_CONTROL, OnEndLabelEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CMyPropertyPage::OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult) 
{
    LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
    if (pDispInfo->item.pszText == NULL)
    {
             //Used clicked escape
     }
     else
     {
            //Data was accepted by user, empty string perhaps?
     }
}