Author: ekohl
Date: Sat May 17 10:19:01 2008
New Revision: 33555
URL:
http://svn.reactos.org/svn/reactos?rev=33555&view=rev
Log:
Limit the maximum user name length to 20 characters when a user name is changed from
within the users list.
Modified:
trunk/reactos/dll/cpl/usrmgr/users.c
Modified: trunk/reactos/dll/cpl/usrmgr/users.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/users.c?rev…
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/users.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/users.c [iso-8859-1] Sat May 17 10:19:01 2008
@@ -487,6 +487,21 @@
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
OnEndLabelEdit(LPNMLVDISPINFO pnmv)
{
TCHAR szOldUserName[UNLEN];
@@ -564,14 +579,17 @@
case NM_DBLCLK:
break;
- case LVN_ENDLABELEDIT:
- return OnEndLabelEdit((LPNMLVDISPINFO)phdr);
-
case NM_RCLICK:
ClientToScreen(GetDlgItem(hwndDlg, IDC_USERS_LIST),
&lpnmlv->ptAction);
TrackPopupMenu(GetSubMenu(pUserData->hPopupMenu, (lpnmlv->iItem
== -1) ? 0 : 1),
TPM_LEFTALIGN, lpnmlv->ptAction.x,
lpnmlv->ptAction.y, 0, hwndDlg, NULL);
break;
+
+ case LVN_BEGINLABELEDIT:
+ return OnBeginLabelEdit((LPNMLVDISPINFO)phdr);
+
+ case LVN_ENDLABELEDIT:
+ return OnEndLabelEdit((LPNMLVDISPINFO)phdr);
}
break;
}