mirror of
https://github.com/reactos/reactos.git
synced 2025-04-30 19:19:00 +00:00
Limit the maximum user name length to 20 characters when a user name is changed from within the users list.
svn path=/trunk/; revision=33555
This commit is contained in:
parent
9e6e290b4f
commit
95b8c49444
1 changed files with 21 additions and 3 deletions
|
@ -486,6 +486,21 @@ OnInitDialog(HWND hwndDlg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static BOOL
|
||||||
|
OnBeginLabelEdit(LPNMLVDISPINFO pnmv)
|
||||||
|
{
|
||||||
|
HWND hwndEdit;
|
||||||
|
|
||||||
|
hwndEdit = ListView_GetEditControl(pnmv->hdr.hwndFrom);
|
||||||
|
if (hwndEdit == NULL)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
SendMessage(hwndEdit, EM_SETLIMITTEXT, 20, 0);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static BOOL
|
static BOOL
|
||||||
OnEndLabelEdit(LPNMLVDISPINFO pnmv)
|
OnEndLabelEdit(LPNMLVDISPINFO pnmv)
|
||||||
{
|
{
|
||||||
|
@ -564,14 +579,17 @@ OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
|
||||||
case NM_DBLCLK:
|
case NM_DBLCLK:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LVN_ENDLABELEDIT:
|
|
||||||
return OnEndLabelEdit((LPNMLVDISPINFO)phdr);
|
|
||||||
|
|
||||||
case NM_RCLICK:
|
case NM_RCLICK:
|
||||||
ClientToScreen(GetDlgItem(hwndDlg, IDC_USERS_LIST), &lpnmlv->ptAction);
|
ClientToScreen(GetDlgItem(hwndDlg, IDC_USERS_LIST), &lpnmlv->ptAction);
|
||||||
TrackPopupMenu(GetSubMenu(pUserData->hPopupMenu, (lpnmlv->iItem == -1) ? 0 : 1),
|
TrackPopupMenu(GetSubMenu(pUserData->hPopupMenu, (lpnmlv->iItem == -1) ? 0 : 1),
|
||||||
TPM_LEFTALIGN, lpnmlv->ptAction.x, lpnmlv->ptAction.y, 0, hwndDlg, NULL);
|
TPM_LEFTALIGN, lpnmlv->ptAction.x, lpnmlv->ptAction.y, 0, hwndDlg, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LVN_BEGINLABELEDIT:
|
||||||
|
return OnBeginLabelEdit((LPNMLVDISPINFO)phdr);
|
||||||
|
|
||||||
|
case LVN_ENDLABELEDIT:
|
||||||
|
return OnEndLabelEdit((LPNMLVDISPINFO)phdr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue