views:

44

answers:

1

how can I differentiate between the two, when the edit field is empty in both cases?
when the user hits escape, I assume user doesn't want the new value at all, when
enter is hit, I assume the user wants an empty string for the edited item...

A: 
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?
     }
}
Angus Connell