[ros-diffs] [ekohl] 33790: - Add a property sheet for user groups. Settings are visible but cannot be changed yet. - Add missing SVN properties.

ekohl at svn.reactos.org ekohl at svn.reactos.org
Sat May 31 21:48:44 CEST 2008


Author: ekohl
Date: Sat May 31 14:48:44 2008
New Revision: 33790

URL: http://svn.reactos.org/svn/reactos?rev=33790&view=rev
Log:
- Add a property sheet for user groups. Settings are visible but cannot be changed yet.
- Add missing SVN properties.

Added:
    trunk/reactos/dll/cpl/usrmgr/groupprops.c   (with props)
Modified:
    trunk/reactos/dll/cpl/usrmgr/extra.c   (contents, props changed)
    trunk/reactos/dll/cpl/usrmgr/groups.c   (contents, props changed)
    trunk/reactos/dll/cpl/usrmgr/lang/en-US.rc
    trunk/reactos/dll/cpl/usrmgr/misc.c
    trunk/reactos/dll/cpl/usrmgr/resource.h
    trunk/reactos/dll/cpl/usrmgr/userprops.c
    trunk/reactos/dll/cpl/usrmgr/usrmgr.c   (contents, props changed)
    trunk/reactos/dll/cpl/usrmgr/usrmgr.def   (contents, props changed)
    trunk/reactos/dll/cpl/usrmgr/usrmgr.h
    trunk/reactos/dll/cpl/usrmgr/usrmgr.rbuild

Modified: trunk/reactos/dll/cpl/usrmgr/extra.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/extra.c?rev=33790&r1=33789&r2=33790&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/extra.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/extra.c [iso-8859-1] Sat May 31 14:48:44 2008
@@ -1,33 +1,33 @@
-/* $Id$
- *
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS User Manager Control Panel
- * FILE:            dll/cpl/usrmgr/extra.c
- * PURPOSE:         Extra property page
- *
- * PROGRAMMERS:     Eric Kohl
- */
-
-#include "usrmgr.h"
-
-INT_PTR CALLBACK
-ExtraPageProc(HWND hwndDlg,
-              UINT uMsg,
-              WPARAM wParam,
-              LPARAM lParam)
-{
-    UNREFERENCED_PARAMETER(lParam);
-    UNREFERENCED_PARAMETER(wParam);
-    UNREFERENCED_PARAMETER(hwndDlg);
-
-    switch (uMsg)
-    {
-        case WM_INITDIALOG:
-            break;
-
-        case WM_COMMAND:
-            break;
-    }
-
-    return FALSE;
-}
+/* $Id$
+ *
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS User Manager Control Panel
+ * FILE:            dll/cpl/usrmgr/extra.c
+ * PURPOSE:         Extra property page
+ *
+ * PROGRAMMERS:     Eric Kohl
+ */
+
+#include "usrmgr.h"
+
+INT_PTR CALLBACK
+ExtraPageProc(HWND hwndDlg,
+              UINT uMsg,
+              WPARAM wParam,
+              LPARAM lParam)
+{
+    UNREFERENCED_PARAMETER(lParam);
+    UNREFERENCED_PARAMETER(wParam);
+    UNREFERENCED_PARAMETER(hwndDlg);
+
+    switch (uMsg)
+    {
+        case WM_INITDIALOG:
+            break;
+
+        case WM_COMMAND:
+            break;
+    }
+
+    return FALSE;
+}

Propchange: trunk/reactos/dll/cpl/usrmgr/extra.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/cpl/usrmgr/groupprops.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/groupprops.c?rev=33790&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/groupprops.c (added)
+++ trunk/reactos/dll/cpl/usrmgr/groupprops.c [iso-8859-1] Sat May 31 14:48:44 2008
@@ -1,0 +1,155 @@
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS User Manager Control Panel
+ * FILE:            dll/cpl/usrmgr/groupprops.c
+ * PURPOSE:         Group property sheet
+ *
+ * PROGRAMMERS:     Eric Kohl
+ */
+
+#include "usrmgr.h"
+
+
+static VOID
+GetGroupData(HWND hwndDlg, LPTSTR lpGroupName)
+{
+    PLOCALGROUP_INFO_1 groupInfo = NULL;
+    PLOCALGROUP_MEMBERS_INFO_1 membersInfo = NULL;
+    DWORD dwRead;
+    DWORD dwTotal;
+    DWORD_PTR resumeHandle = 0;
+    DWORD i;
+    LV_ITEM lvi;
+    HWND hwndLV;
+    LV_COLUMN column;
+    RECT rect;
+    HIMAGELIST hImgList;
+    HICON hIcon;
+
+    hwndLV = GetDlgItem(hwndDlg, IDC_GROUP_GENERAL_MEMBERS);
+
+    /* Create the image list */
+    hImgList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 5, 5);
+    hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+    ImageList_AddIcon(hImgList, hIcon);
+    hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_GROUP), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+    ImageList_AddIcon(hImgList, hIcon);
+    DestroyIcon(hIcon);
+
+    (void)ListView_SetImageList(hwndLV, hImgList, LVSIL_SMALL);
+
+    /* Set the list column */
+    GetClientRect(hwndLV, &rect);
+
+    memset(&column, 0x00, sizeof(column));
+    column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
+    column.fmt = LVCFMT_LEFT;
+    column.cx = (INT)(rect.right - rect.left);
+    column.iSubItem = 0;
+    (void)ListView_InsertColumn(hwndLV, 0, &column);
+
+    /* Set group name */
+    SetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_NAME, lpGroupName);
+
+    /* Set group description */
+    NetLocalGroupGetInfo(NULL, lpGroupName, 1, (LPBYTE*)&groupInfo);
+    SetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_DESCRIPTION, groupInfo->lgrpi1_comment);
+    NetApiBufferFree(groupInfo);
+
+    /* Set group members */
+    NetLocalGroupGetMembers(NULL, lpGroupName, 1, (LPBYTE*)&membersInfo,
+                            MAX_PREFERRED_LENGTH, &dwRead, &dwTotal,
+                            &resumeHandle);
+
+    for (i = 0; i < dwRead; i++)
+    {
+        ZeroMemory(&lvi, sizeof(lvi));
+        lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
+        lvi.pszText = membersInfo[i].lgrmi1_name;
+        lvi.state = 0;
+        lvi.iImage = (membersInfo[i].lgrmi1_sidusage == SidTypeGroup ||
+                      membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup) ? 1 : 0;
+
+        (void)ListView_InsertItem(hwndLV, &lvi);
+    }
+
+    NetApiBufferFree(membersInfo);
+}
+
+
+INT_PTR CALLBACK
+GroupGeneralPageProc(HWND hwndDlg,
+                     UINT uMsg,
+                     WPARAM wParam,
+                     LPARAM lParam)
+{
+    UNREFERENCED_PARAMETER(lParam);
+    UNREFERENCED_PARAMETER(wParam);
+    UNREFERENCED_PARAMETER(hwndDlg);
+
+    switch (uMsg)
+    {
+        case WM_INITDIALOG:
+            GetGroupData(hwndDlg,
+                         (LPTSTR)((PROPSHEETPAGE *)lParam)->lParam);
+            break;
+
+        case WM_COMMAND:
+            break;
+
+        case WM_DESTROY:
+            break;
+    }
+
+    return FALSE;
+}
+
+
+static VOID
+InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, LPTSTR pszGroup)
+{
+    ZeroMemory(psp, sizeof(PROPSHEETPAGE));
+    psp->dwSize = sizeof(PROPSHEETPAGE);
+    psp->dwFlags = PSP_DEFAULT;
+    psp->hInstance = hApplet;
+    psp->pszTemplate = MAKEINTRESOURCE(idDlg);
+    psp->pfnDlgProc = DlgProc;
+    psp->lParam = (LPARAM)pszGroup;
+}
+
+
+VOID
+GroupProperties(HWND hwndDlg)
+{
+    PROPSHEETPAGE psp[1];
+    PROPSHEETHEADER psh;
+    TCHAR szGroupName[UNLEN];
+    INT nItem;
+    HWND hwndLV;
+
+    hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
+    nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
+    if (nItem == -1)
+        return;
+
+    /* Get the new user name */
+    ListView_GetItemText(hwndLV,
+                         nItem, 0,
+                         szGroupName,
+                         UNLEN);
+
+    ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
+    psh.dwSize = sizeof(PROPSHEETHEADER);
+    psh.dwFlags =  PSH_PROPSHEETPAGE | PSH_PROPTITLE;
+    psh.hwndParent = hwndDlg;
+    psh.hInstance = hApplet;
+    psh.hIcon = NULL;
+    psh.pszCaption = szGroupName;
+    psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
+    psh.nStartPage = 0;
+    psh.ppsp = psp;
+
+    InitPropSheetPage(&psp[0], IDD_GROUP_GENERAL, (DLGPROC)GroupGeneralPageProc, szGroupName);
+
+    PropertySheet(&psh);
+}

Propchange: trunk/reactos/dll/cpl/usrmgr/groupprops.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/dll/cpl/usrmgr/groups.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/groups.c?rev=33790&r1=33789&r2=33790&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/groups.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/groups.c [iso-8859-1] Sat May 31 14:48:44 2008
@@ -1,471 +1,479 @@
-/*
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS User Manager Control Panel
- * FILE:            dll/cpl/usrmgr/groups.c
- * PURPOSE:         Groups property page
- *
- * PROGRAMMERS:     Eric Kohl
- */
-
-#include "usrmgr.h"
-
-typedef struct _GROUP_DATA
-{
-    HMENU hPopupMenu;
-
-    INT iCurrentItem;
-
-} GROUP_DATA, *PGROUP_DATA;
-
-
-static VOID
-SetGroupsListColumns(HWND hwndListView)
-{
-    LV_COLUMN column;
-    RECT rect;
-    TCHAR szStr[32];
-
-    GetClientRect(hwndListView, &rect);
-
-    memset(&column, 0x00, sizeof(column));
-    column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT;
-    column.fmt = LVCFMT_LEFT;
-    column.cx = (INT)((rect.right - rect.left) * 0.40);
-    column.iSubItem = 0;
-    LoadString(hApplet, IDS_NAME, szStr, sizeof(szStr) / sizeof(szStr[0]));
-    column.pszText = szStr;
-    (void)ListView_InsertColumn(hwndListView, 0, &column);
-
-    column.cx = (INT)((rect.right - rect.left) * 0.60);
-    column.iSubItem = 1;
-    LoadString(hApplet, IDS_DESCRIPTION, szStr, sizeof(szStr) / sizeof(szStr[0]));
-    column.pszText = szStr;
-    (void)ListView_InsertColumn(hwndListView, 1, &column);
-}
-
-
-static VOID
-UpdateGroupsList(HWND hwndListView)
-{
-    NET_API_STATUS netStatus;
-    PLOCALGROUP_INFO_1 pBuffer;
-    DWORD entriesread;
-    DWORD totalentries;
-    DWORD resume_handle = 0;
-    DWORD i;
-
-    LV_ITEM lvi;
-    INT iItem;
-
-
-    for (;;)
-    {
-        netStatus = NetLocalGroupEnum(NULL, 1, (LPBYTE*)&pBuffer,
-                                      1024, &entriesread,
-                                      &totalentries, &resume_handle);
-        if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA)
-            break;
-
-        for (i = 0; i < entriesread; i++)
-        {
-           memset(&lvi, 0x00, sizeof(lvi));
-           lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
-           lvi.pszText = pBuffer[i].lgrpi1_name;
-           lvi.state = 0;
-           lvi.iImage = 0;
-           iItem = ListView_InsertItem(hwndListView, &lvi);
-
-           ListView_SetItemText(hwndListView, iItem, 1,
-                                pBuffer[i].lgrpi1_comment);
-        }
-
-        NetApiBufferFree(&pBuffer);
-
-        /* No more data left */
-        if (netStatus != ERROR_MORE_DATA)
-            break;
-    }
-
-}
-
-
-INT_PTR CALLBACK
-NewGroupDlgProc(HWND hwndDlg,
-               UINT uMsg,
-               WPARAM wParam,
-               LPARAM lParam)
-{
-    PLOCALGROUP_INFO_1 groupInfo;
-    INT nLength;
-
-    UNREFERENCED_PARAMETER(wParam);
-
-    groupInfo = (PLOCALGROUP_INFO_1)GetWindowLongPtr(hwndDlg, DWLP_USER);
-
-    switch (uMsg)
-    {
-        case WM_INITDIALOG:
-            SetWindowLongPtr(hwndDlg, DWLP_USER, lParam);
-            groupInfo = (PLOCALGROUP_INFO_1)lParam;
-            SendDlgItemMessage(hwndDlg, IDC_GROUP_NEW_NAME, EM_SETLIMITTEXT, 20, 0);
-            break;
-
-        case WM_COMMAND:
-            switch (LOWORD(wParam))
-            {
-                case IDC_GROUP_NEW_NAME:
-                    if (HIWORD(wParam) == EN_CHANGE)
-                    {
-                        nLength = SendDlgItemMessage(hwndDlg, IDC_GROUP_NEW_NAME, WM_GETTEXTLENGTH, 0, 0);
-                        EnableWindow(GetDlgItem(hwndDlg, IDOK), (nLength > 0));
-                    }
-                    break;
-
-                case IDOK:
-                    if (!CheckAccountName(hwndDlg, IDC_GROUP_NEW_NAME, NULL))
-                    {
-                        SetFocus(GetDlgItem(hwndDlg, IDC_GROUP_NEW_NAME));
-                        SendDlgItemMessage(hwndDlg, IDC_GROUP_NEW_NAME, EM_SETSEL, 0, -1);
-                        break;
-                    }
-
-                    nLength = SendDlgItemMessage(hwndDlg, IDC_GROUP_NEW_NAME, WM_GETTEXTLENGTH, 0, 0);
-                    if (nLength > 0)
-                    {
-                        groupInfo->lgrpi1_name = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR));
-                        GetDlgItemText(hwndDlg, IDC_GROUP_NEW_NAME, groupInfo->lgrpi1_name, nLength + 1);
-                    }
-
-                    nLength = SendDlgItemMessage(hwndDlg, IDC_GROUP_NEW_DESCRIPTION, WM_GETTEXTLENGTH, 0, 0);
-                    if (nLength > 0)
-                    {
-                        groupInfo->lgrpi1_comment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR));
-                        GetDlgItemText(hwndDlg, IDC_GROUP_NEW_DESCRIPTION, groupInfo->lgrpi1_comment, nLength + 1);
-                    }
-
-                    EndDialog(hwndDlg, IDOK);
-                    break;
-
-                case IDCANCEL:
-                    EndDialog(hwndDlg, IDCANCEL);
-                    break;
-            }
-            break;
-
-        default:
-            return FALSE;
-    }
-
-    return TRUE;
-}
-
-
-static VOID
-GroupNew(HWND hwndDlg)
-{
-    NET_API_STATUS status;
-    LOCALGROUP_INFO_1 group;
-    LV_ITEM lvi;
-    INT iItem;
-    HWND hwndLV;
-
-    ZeroMemory(&group, sizeof(LOCALGROUP_INFO_1));
-
-    if (DialogBoxParam(hApplet,
-                       MAKEINTRESOURCE(IDD_GROUP_NEW),
-                       hwndDlg,
-                       NewGroupDlgProc,
-                       (LPARAM)&group) == IDOK)
-    {
-#if 0
-        status = NetLocalGroupAdd(NULL,
-                                  1,
-                                  (LPBYTE)&group,
-                                  NULL);
-#else
-        status = NERR_Success;
-#endif
-        if (status != NERR_Success)
-        {
-            TCHAR szText[256];
-            wsprintf(szText, TEXT("Error: %u"), status);
-            MessageBox(NULL, szText, TEXT("NetUserAdd"), MB_ICONERROR | MB_OK);
-            return;
-        }
-
-        hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
-
-        ZeroMemory(&lvi, sizeof(lvi));
-        lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
-        lvi.pszText = group.lgrpi1_name;
-        lvi.state = 0;
-        lvi.iImage = 0;
-        iItem = ListView_InsertItem(hwndLV, &lvi);
-
-        ListView_SetItemText(hwndLV, iItem, 1,
-                             group.lgrpi1_comment);
-    }
-
-    if (group.lgrpi1_name)
-        HeapFree(GetProcessHeap, 0, group.lgrpi1_name);
-
-    if (group.lgrpi1_comment)
-        HeapFree(GetProcessHeap, 0, group.lgrpi1_comment);
-}
-
-
-static VOID
-GroupRename(HWND hwndDlg)
-{
-    INT nItem;
-    HWND hwndLV;
-
-    hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
-    nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
-    if (nItem != -1)
-    {
-        (void)ListView_EditLabel(hwndLV, nItem);
-    }
-}
-
-
-static BOOL
-GroupDelete(HWND hwndDlg)
-{
-    TCHAR szGroupName[UNLEN];
-    TCHAR szText[256];
-    INT nItem;
-    HWND hwndLV;
-    NET_API_STATUS status;
-
-    hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
-    nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
-    if (nItem == -1)
-        return FALSE;
-
-    /* Get the new group name */
-    ListView_GetItemText(hwndLV,
-                         nItem, 0,
-                         szGroupName,
-                         UNLEN);
-
-    /* Display a warning message because the delete operation cannot be reverted */
-    wsprintf(szText, TEXT("Dou you really want to delete the user group \"%s\"?"), szGroupName);
-    if (MessageBox(NULL, szText, TEXT("User Groups"), MB_ICONWARNING | MB_YESNO) == IDNO)
-        return FALSE;
-
-    /* Delete the group */
-#if 0
-    status = NetLocalGroupDel(NULL, szGroupName);
-#else
-    status = NERR_Success;
-#endif
-    if (status != NERR_Success)
-    {
-        TCHAR szText[256];
-        wsprintf(szText, TEXT("Error: %u"), status);
-        MessageBox(NULL, szText, TEXT("NetLocalGroupDel"), MB_ICONERROR | MB_OK);
-        return FALSE;
-    }
-
-    /* Delete the group from the list */
-    (void)ListView_DeleteItem(hwndLV, nItem);
-
-    return TRUE;
-}
-
-
-static VOID
-OnInitDialog(HWND hwndDlg)
-{
-    HWND hwndListView;
-    HIMAGELIST hImgList;
-    HICON hIcon;
-
-    /* Create the image list */
-    hImgList = ImageList_Create(16,16,ILC_COLOR8 | ILC_MASK,5,5);
-    hIcon = LoadImage(hApplet,MAKEINTRESOURCE(IDI_GROUP),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
-    ImageList_AddIcon(hImgList,hIcon);
-    DestroyIcon(hIcon);
-
-    hwndListView = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
-
-    (VOID)ListView_SetImageList(hwndListView, hImgList, LVSIL_SMALL);
-
-    (void)ListView_SetExtendedListViewStyle(hwndListView, LVS_EX_FULLROWSELECT);
-
-    SetGroupsListColumns(hwndListView);
-
-    UpdateGroupsList(hwndListView);
-}
-
-
-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 szOldGroupName[UNLEN];
-    TCHAR szNewGroupName[UNLEN];
-    LOCALGROUP_INFO_0 lgrpi0;
-    NET_API_STATUS status;
-
-    /* Leave, if there is no valid listview item */
-    if (pnmv->item.iItem == -1)
-        return FALSE;
-
-    /* Get the new user name */
-    ListView_GetItemText(pnmv->hdr.hwndFrom,
-                         pnmv->item.iItem, 0,
-                         szOldGroupName,
-                         UNLEN);
-
-    /* Leave, if the user canceled the edit action */
-    if (pnmv->item.pszText == NULL)
-        return FALSE;
-
-    /* Get the new user name */
-    lstrcpy(szNewGroupName, pnmv->item.pszText);
-
-    /* Leave, if the user name was not changed */
-    if (lstrcmp(szOldGroupName, szNewGroupName) == 0)
-        return FALSE;
-
-    /* Check the group name for illegal characters */
-    if (!CheckAccountName(NULL, 0, szNewGroupName))
-        return FALSE;
-
-    /* Change the user name */
-    lgrpi0.lgrpi0_name = szNewGroupName;
-
-#if 0
-    status = NetLocalGroupSetInfo(NULL, szOldGroupName, 0, (LPBYTE)&lgrpi0, NULL);
-#else
-    status = NERR_Success;
-#endif
-    if (status != NERR_Success)
-    {
-        TCHAR szText[256];
-        wsprintf(szText, TEXT("Error: %u"), status);
-        MessageBox(NULL, szText, TEXT("NetLocalGroupSetInfo"), MB_ICONERROR | MB_OK);
-        return FALSE;
-    }
-
-    /* Update the listview item */
-    ListView_SetItemText(pnmv->hdr.hwndFrom,
-                         pnmv->item.iItem, 0,
-                         szNewGroupName);
-
-    return TRUE;
-}
-
-
-static BOOL
-OnNotify(HWND hwndDlg, PGROUP_DATA pGroupData, NMHDR *phdr)
-{
-    LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
-
-    switch (phdr->idFrom)
-    {
-        case IDC_GROUPS_LIST:
-            switch(phdr->code)
-            {
-                case NM_CLICK:
-                    pGroupData->iCurrentItem = lpnmlv->iItem;
-                    if (lpnmlv->iItem == -1)
-                    {
-                    }
-                    else
-                    {
-                    }
-                    break;
-
-                case NM_DBLCLK:
-                    break;
-
-                case NM_RCLICK:
-                    ClientToScreen(GetDlgItem(hwndDlg, IDC_GROUPS_LIST), &lpnmlv->ptAction);
-                    TrackPopupMenu(GetSubMenu(pGroupData->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;
-    }
-
-    return FALSE;
-}
-
-
-INT_PTR CALLBACK
-GroupsPageProc(HWND hwndDlg,
-               UINT uMsg,
-               WPARAM wParam,
-               LPARAM lParam)
-{
-    PGROUP_DATA pGroupData;
-
-    UNREFERENCED_PARAMETER(lParam);
-    UNREFERENCED_PARAMETER(wParam);
-    UNREFERENCED_PARAMETER(hwndDlg);
-
-
-    pGroupData = (PGROUP_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
-
-    switch (uMsg)
-    {
-        case WM_INITDIALOG:
-            pGroupData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GROUP_DATA));
-            SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGroupData);
-
-            pGroupData->hPopupMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDM_POPUP_GROUP));
-
-            OnInitDialog(hwndDlg);
-            break;
-
-        case WM_COMMAND:
-            switch (LOWORD(wParam))
-            {
-                case IDM_GROUP_NEW:
-                    GroupNew(hwndDlg);
-                    break;
-
-                case IDM_GROUP_RENAME:
-                    GroupRename(hwndDlg);
-                    break;
-
-                case IDM_GROUP_DELETE:
-                    GroupDelete(hwndDlg);
-                    break;
-            }
-            break;
-
-        case WM_NOTIFY:
-            return OnNotify(hwndDlg, pGroupData, (NMHDR *)lParam);
-
-        case WM_DESTROY:
-            DestroyMenu(pGroupData->hPopupMenu);
-            HeapFree(GetProcessHeap(), 0, pGroupData);
-            break;
-    }
-
-    return FALSE;
-}
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS User Manager Control Panel
+ * FILE:            dll/cpl/usrmgr/groups.c
+ * PURPOSE:         Groups property page
+ *
+ * PROGRAMMERS:     Eric Kohl
+ */
+
+#include "usrmgr.h"
+
+typedef struct _GROUP_DATA
+{
+    HMENU hPopupMenu;
+
+    INT iCurrentItem;
+
+} GROUP_DATA, *PGROUP_DATA;
+
+
+static VOID
+SetGroupsListColumns(HWND hwndListView)
+{
+    LV_COLUMN column;
+    RECT rect;
+    TCHAR szStr[32];
+
+    GetClientRect(hwndListView, &rect);
+
+    memset(&column, 0x00, sizeof(column));
+    column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT;
+    column.fmt = LVCFMT_LEFT;
+    column.cx = (INT)((rect.right - rect.left) * 0.40);
+    column.iSubItem = 0;
+    LoadString(hApplet, IDS_NAME, szStr, sizeof(szStr) / sizeof(szStr[0]));
+    column.pszText = szStr;
+    (void)ListView_InsertColumn(hwndListView, 0, &column);
+
+    column.cx = (INT)((rect.right - rect.left) * 0.60);
+    column.iSubItem = 1;
+    LoadString(hApplet, IDS_DESCRIPTION, szStr, sizeof(szStr) / sizeof(szStr[0]));
+    column.pszText = szStr;
+    (void)ListView_InsertColumn(hwndListView, 1, &column);
+}
+
+
+static VOID
+UpdateGroupsList(HWND hwndListView)
+{
+    NET_API_STATUS netStatus;
+    PLOCALGROUP_INFO_1 pBuffer;
+    DWORD entriesread;
+    DWORD totalentries;
+    DWORD resume_handle = 0;
+    DWORD i;
+    LV_ITEM lvi;
+    INT iItem;
+
+    for (;;)
+    {
+        netStatus = NetLocalGroupEnum(NULL, 1, (LPBYTE*)&pBuffer,
+                                      1024, &entriesread,
+                                      &totalentries, &resume_handle);
+        if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA)
+            break;
+
+        for (i = 0; i < entriesread; i++)
+        {
+           memset(&lvi, 0x00, sizeof(lvi));
+           lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
+           lvi.pszText = pBuffer[i].lgrpi1_name;
+           lvi.state = 0;
+           lvi.iImage = 0;
+           iItem = ListView_InsertItem(hwndListView, &lvi);
+
+           ListView_SetItemText(hwndListView, iItem, 1,
+                                pBuffer[i].lgrpi1_comment);
+        }
+
+        NetApiBufferFree(&pBuffer);
+
+        /* No more data left */
+        if (netStatus != ERROR_MORE_DATA)
+            break;
+    }
+
+}
+
+
+INT_PTR CALLBACK
+NewGroupDlgProc(HWND hwndDlg,
+               UINT uMsg,
+               WPARAM wParam,
+               LPARAM lParam)
+{
+    PLOCALGROUP_INFO_1 groupInfo;
+    INT nLength;
+
+    UNREFERENCED_PARAMETER(wParam);
+
+    groupInfo = (PLOCALGROUP_INFO_1)GetWindowLongPtr(hwndDlg, DWLP_USER);
+
+    switch (uMsg)
+    {
+        case WM_INITDIALOG:
+            SetWindowLongPtr(hwndDlg, DWLP_USER, lParam);
+            groupInfo = (PLOCALGROUP_INFO_1)lParam;
+            SendDlgItemMessage(hwndDlg, IDC_GROUP_NEW_NAME, EM_SETLIMITTEXT, 20, 0);
+            break;
+
+        case WM_COMMAND:
+            switch (LOWORD(wParam))
+            {
+                case IDC_GROUP_NEW_NAME:
+                    if (HIWORD(wParam) == EN_CHANGE)
+                    {
+                        nLength = SendDlgItemMessage(hwndDlg, IDC_GROUP_NEW_NAME, WM_GETTEXTLENGTH, 0, 0);
+                        EnableWindow(GetDlgItem(hwndDlg, IDOK), (nLength > 0));
+                    }
+                    break;
+
+                case IDOK:
+                    if (!CheckAccountName(hwndDlg, IDC_GROUP_NEW_NAME, NULL))
+                    {
+                        SetFocus(GetDlgItem(hwndDlg, IDC_GROUP_NEW_NAME));
+                        SendDlgItemMessage(hwndDlg, IDC_GROUP_NEW_NAME, EM_SETSEL, 0, -1);
+                        break;
+                    }
+
+                    nLength = SendDlgItemMessage(hwndDlg, IDC_GROUP_NEW_NAME, WM_GETTEXTLENGTH, 0, 0);
+                    if (nLength > 0)
+                    {
+                        groupInfo->lgrpi1_name = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR));
+                        GetDlgItemText(hwndDlg, IDC_GROUP_NEW_NAME, groupInfo->lgrpi1_name, nLength + 1);
+                    }
+
+                    nLength = SendDlgItemMessage(hwndDlg, IDC_GROUP_NEW_DESCRIPTION, WM_GETTEXTLENGTH, 0, 0);
+                    if (nLength > 0)
+                    {
+                        groupInfo->lgrpi1_comment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR));
+                        GetDlgItemText(hwndDlg, IDC_GROUP_NEW_DESCRIPTION, groupInfo->lgrpi1_comment, nLength + 1);
+                    }
+
+                    EndDialog(hwndDlg, IDOK);
+                    break;
+
+                case IDCANCEL:
+                    EndDialog(hwndDlg, IDCANCEL);
+                    break;
+            }
+            break;
+
+        default:
+            return FALSE;
+    }
+
+    return TRUE;
+}
+
+
+static VOID
+GroupNew(HWND hwndDlg)
+{
+    NET_API_STATUS status;
+    LOCALGROUP_INFO_1 group;
+    LV_ITEM lvi;
+    INT iItem;
+    HWND hwndLV;
+
+    ZeroMemory(&group, sizeof(LOCALGROUP_INFO_1));
+
+    if (DialogBoxParam(hApplet,
+                       MAKEINTRESOURCE(IDD_GROUP_NEW),
+                       hwndDlg,
+                       NewGroupDlgProc,
+                       (LPARAM)&group) == IDOK)
+    {
+#if 0
+        status = NetLocalGroupAdd(NULL,
+                                  1,
+                                  (LPBYTE)&group,
+                                  NULL);
+#else
+        status = NERR_Success;
+#endif
+        if (status != NERR_Success)
+        {
+            TCHAR szText[256];
+            wsprintf(szText, TEXT("Error: %u"), status);
+            MessageBox(NULL, szText, TEXT("NetUserAdd"), MB_ICONERROR | MB_OK);
+            return;
+        }
+
+        hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
+
+        ZeroMemory(&lvi, sizeof(lvi));
+        lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
+        lvi.pszText = group.lgrpi1_name;
+        lvi.state = 0;
+        lvi.iImage = 0;
+        iItem = ListView_InsertItem(hwndLV, &lvi);
+
+        ListView_SetItemText(hwndLV, iItem, 1,
+                             group.lgrpi1_comment);
+    }
+
+    if (group.lgrpi1_name)
+        HeapFree(GetProcessHeap, 0, group.lgrpi1_name);
+
+    if (group.lgrpi1_comment)
+        HeapFree(GetProcessHeap, 0, group.lgrpi1_comment);
+}
+
+
+static VOID
+GroupRename(HWND hwndDlg)
+{
+    INT nItem;
+    HWND hwndLV;
+
+    hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
+    nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
+    if (nItem != -1)
+    {
+        (void)ListView_EditLabel(hwndLV, nItem);
+    }
+}
+
+
+static BOOL
+GroupDelete(HWND hwndDlg)
+{
+    TCHAR szGroupName[UNLEN];
+    TCHAR szText[256];
+    INT nItem;
+    HWND hwndLV;
+    NET_API_STATUS status;
+
+    hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
+    nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
+    if (nItem == -1)
+        return FALSE;
+
+    /* Get the new group name */
+    ListView_GetItemText(hwndLV,
+                         nItem, 0,
+                         szGroupName,
+                         UNLEN);
+
+    /* Display a warning message because the delete operation cannot be reverted */
+    wsprintf(szText, TEXT("Dou you really want to delete the user group \"%s\"?"), szGroupName);
+    if (MessageBox(NULL, szText, TEXT("User Groups"), MB_ICONWARNING | MB_YESNO) == IDNO)
+        return FALSE;
+
+    /* Delete the group */
+#if 0
+    status = NetLocalGroupDel(NULL, szGroupName);
+#else
+    status = NERR_Success;
+#endif
+    if (status != NERR_Success)
+    {
+        TCHAR szText[256];
+        wsprintf(szText, TEXT("Error: %u"), status);
+        MessageBox(NULL, szText, TEXT("NetLocalGroupDel"), MB_ICONERROR | MB_OK);
+        return FALSE;
+    }
+
+    /* Delete the group from the list */
+    (void)ListView_DeleteItem(hwndLV, nItem);
+
+    return TRUE;
+}
+
+
+static VOID
+OnInitDialog(HWND hwndDlg)
+{
+    HWND hwndListView;
+    HIMAGELIST hImgList;
+    HICON hIcon;
+
+    /* Create the image list */
+    hImgList = ImageList_Create(16,16,ILC_COLOR8 | ILC_MASK,5,5);
+    hIcon = LoadImage(hApplet,MAKEINTRESOURCE(IDI_GROUP),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
+    ImageList_AddIcon(hImgList,hIcon);
+    DestroyIcon(hIcon);
+
+    hwndListView = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
+
+    (VOID)ListView_SetImageList(hwndListView, hImgList, LVSIL_SMALL);
+
+    (void)ListView_SetExtendedListViewStyle(hwndListView, LVS_EX_FULLROWSELECT);
+
+    SetGroupsListColumns(hwndListView);
+
+    UpdateGroupsList(hwndListView);
+}
+
+
+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 szOldGroupName[UNLEN];
+    TCHAR szNewGroupName[UNLEN];
+    LOCALGROUP_INFO_0 lgrpi0;
+    NET_API_STATUS status;
+
+    /* Leave, if there is no valid listview item */
+    if (pnmv->item.iItem == -1)
+        return FALSE;
+
+    /* Get the new user name */
+    ListView_GetItemText(pnmv->hdr.hwndFrom,
+                         pnmv->item.iItem, 0,
+                         szOldGroupName,
+                         UNLEN);
+
+    /* Leave, if the user canceled the edit action */
+    if (pnmv->item.pszText == NULL)
+        return FALSE;
+
+    /* Get the new user name */
+    lstrcpy(szNewGroupName, pnmv->item.pszText);
+
+    /* Leave, if the user name was not changed */
+    if (lstrcmp(szOldGroupName, szNewGroupName) == 0)
+        return FALSE;
+
+    /* Check the group name for illegal characters */
+    if (!CheckAccountName(NULL, 0, szNewGroupName))
+        return FALSE;
+
+    /* Change the user name */
+    lgrpi0.lgrpi0_name = szNewGroupName;
+
+#if 0
+    status = NetLocalGroupSetInfo(NULL, szOldGroupName, 0, (LPBYTE)&lgrpi0, NULL);
+#else
+    status = NERR_Success;
+#endif
+    if (status != NERR_Success)
+    {
+        TCHAR szText[256];
+        wsprintf(szText, TEXT("Error: %u"), status);
+        MessageBox(NULL, szText, TEXT("NetLocalGroupSetInfo"), MB_ICONERROR | MB_OK);
+        return FALSE;
+    }
+
+    /* Update the listview item */
+    ListView_SetItemText(pnmv->hdr.hwndFrom,
+                         pnmv->item.iItem, 0,
+                         szNewGroupName);
+
+    return TRUE;
+}
+
+
+static BOOL
+OnNotify(HWND hwndDlg, PGROUP_DATA pGroupData, NMHDR *phdr)
+{
+    LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
+
+    switch (phdr->idFrom)
+    {
+        case IDC_GROUPS_LIST:
+            switch(phdr->code)
+            {
+                case NM_CLICK:
+                    pGroupData->iCurrentItem = lpnmlv->iItem;
+                    break;
+
+                case NM_DBLCLK:
+                    if (lpnmlv->iItem != -1)
+                    {
+                        UINT uItem;
+
+                        uItem =  GetMenuDefaultItem(GetSubMenu(pGroupData->hPopupMenu, 1),
+                                                    FALSE, 0);
+                        if (uItem != (UINT)-1)
+                            SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(uItem, 0), 0);
+                    }
+                    break;
+
+                case NM_RCLICK:
+                    ClientToScreen(GetDlgItem(hwndDlg, IDC_GROUPS_LIST), &lpnmlv->ptAction);
+                    TrackPopupMenu(GetSubMenu(pGroupData->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;
+    }
+
+    return FALSE;
+}
+
+
+INT_PTR CALLBACK
+GroupsPageProc(HWND hwndDlg,
+               UINT uMsg,
+               WPARAM wParam,
+               LPARAM lParam)
+{
+    PGROUP_DATA pGroupData;
+
+    UNREFERENCED_PARAMETER(lParam);
+    UNREFERENCED_PARAMETER(wParam);
+    UNREFERENCED_PARAMETER(hwndDlg);
+
+
+    pGroupData = (PGROUP_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
+
+    switch (uMsg)
+    {
+        case WM_INITDIALOG:
+            pGroupData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GROUP_DATA));
+            SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGroupData);
+
+            pGroupData->hPopupMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDM_POPUP_GROUP));
+
+            OnInitDialog(hwndDlg);
+            SetMenuDefaultItem(GetSubMenu(pGroupData->hPopupMenu, 1),
+                               IDM_GROUP_PROPERTIES,
+                               FALSE);
+            break;
+
+        case WM_COMMAND:
+            switch (LOWORD(wParam))
+            {
+                case IDM_GROUP_NEW:
+                    GroupNew(hwndDlg);
+                    break;
+
+                case IDM_GROUP_RENAME:
+                    GroupRename(hwndDlg);
+                    break;
+
+                case IDM_GROUP_DELETE:
+                    GroupDelete(hwndDlg);
+                    break;
+
+                case IDM_GROUP_PROPERTIES:
+                    GroupProperties(hwndDlg);
+                    break;
+            }
+            break;
+
+        case WM_NOTIFY:
+            return OnNotify(hwndDlg, pGroupData, (NMHDR *)lParam);
+
+        case WM_DESTROY:
+            DestroyMenu(pGroupData->hPopupMenu);
+            HeapFree(GetProcessHeap(), 0, pGroupData);
+            break;
+    }
+
+    return FALSE;
+}

Propchange: trunk/reactos/dll/cpl/usrmgr/groups.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/dll/cpl/usrmgr/lang/en-US.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/lang/en-US.rc?rev=33790&r1=33789&r2=33790&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/lang/en-US.rc [iso-8859-1] Sat May 31 14:48:44 2008
@@ -41,7 +41,7 @@
 CAPTION "General"
 FONT 8, "MS Shell Dlg"
 BEGIN
-    LTEXT "", IDC_USER_GENERAL_NAME, 7, 7, 112, 8
+    LTEXT "", IDC_USER_GENERAL_NAME, 7, 12, 112, 8
     LTEXT "Full name:", -1, 7, 46, 63, 8
     EDITTEXT IDC_USER_GENERAL_FULL_NAME,77,43,168,13,ES_AUTOHSCROLL
     LTEXT "Description:", -1, 7, 64, 63, 8
@@ -51,6 +51,20 @@
     AUTOCHECKBOX    "Password never expires",IDC_USER_GENERAL_NEVER_EXPIRES,7,108,210,10
     AUTOCHECKBOX    "Account is disabled",IDC_USER_GENERAL_DISABLED,7,121,210,10
     AUTOCHECKBOX    "Account is locked",IDC_USER_GENERAL_LOCKED,7,134,210,10,WS_DISABLED
+END
+
+
+IDD_GROUP_GENERAL DIALOGEX DISCARDABLE  0, 0, 252, 223
+STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "General"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "", IDC_GROUP_GENERAL_NAME, 7, 12, 112, 8
+    LTEXT "Description:", -1, 7, 45, 46, 8
+    EDITTEXT IDC_GROUP_GENERAL_DESCRIPTION,65,42,180,13,ES_AUTOHSCROLL
+    LTEXT "Members:", -1, 7, 63, 45, 8
+    CONTROL "", IDC_GROUP_GENERAL_MEMBERS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,
+            7, 74, 238, 117, WS_EX_CLIENTEDGE
 END
 
 
@@ -121,7 +135,7 @@
         MENUITEM "Delete", IDM_GROUP_DELETE
         MENUITEM "Rename", IDM_GROUP_RENAME
         MENUITEM SEPARATOR
-        MENUITEM "Properties", IDM_GROUP_PROPERTIES, GRAYED
+        MENUITEM "Properties", IDM_GROUP_PROPERTIES
     END
 END
 

Modified: trunk/reactos/dll/cpl/usrmgr/misc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/misc.c?rev=33790&r1=33789&r2=33790&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/misc.c [iso-8859-1] Sat May 31 14:48:44 2008
@@ -9,6 +9,20 @@
 
 #include "usrmgr.h"
 
+
+VOID
+DebugPrintf(LPTSTR szFormat, ...)
+{
+    TCHAR szOut[512];
+    va_list arg_ptr;
+
+
+    va_start (arg_ptr, szFormat);
+    _vstprintf (szOut, szFormat, arg_ptr);
+    va_end (arg_ptr);
+
+    MessageBox(NULL, szOut, _T("Debug"), MB_OK);
+}
 
 BOOL
 CheckAccountName(HWND hwndDlg,

Modified: trunk/reactos/dll/cpl/usrmgr/resource.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/resource.h?rev=33790&r1=33789&r2=33790&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/resource.h [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/resource.h [iso-8859-1] Sat May 31 14:48:44 2008
@@ -44,6 +44,11 @@
 #define IDC_USER_GENERAL_NEVER_EXPIRES 316
 #define IDC_USER_GENERAL_DISABLED      317
 #define IDC_USER_GENERAL_LOCKED        318
+
+#define IDD_GROUP_GENERAL              340
+#define IDC_GROUP_GENERAL_NAME         341
+#define IDC_GROUP_GENERAL_DESCRIPTION  342
+#define IDC_GROUP_GENERAL_MEMBERS      343
 
 
 #define IDD_CHANGE_PASSWORD         350

Modified: trunk/reactos/dll/cpl/usrmgr/userprops.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/userprops.c?rev=33790&r1=33789&r2=33790&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/userprops.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/userprops.c [iso-8859-1] Sat May 31 14:48:44 2008
@@ -2,7 +2,7 @@
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS User Manager Control Panel
  * FILE:            dll/cpl/usrmgr/users.c
- * PURPOSE:         Users property page
+ * PURPOSE:         User property sheet
  *
  * PROGRAMMERS:     Eric Kohl
  */

Modified: trunk/reactos/dll/cpl/usrmgr/usrmgr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/usrmgr.c?rev=33790&r1=33789&r2=33790&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/usrmgr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/usrmgr.c [iso-8859-1] Sat May 31 14:48:44 2008
@@ -1,122 +1,122 @@
-/* $Id$
- *
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS User Manager Control Panel
- * FILE:            dll/cpl/usrmgr/extra.c
- * PURPOSE:         Main functions
- *
- * PROGRAMMERS:     Eric Kohl
- */
-
-#include "usrmgr.h"
-
-#define NUM_APPLETS 1
-
-static LONG APIENTRY UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam);
-
-HINSTANCE hApplet = 0;
-
-/* Applets */
-APPLET Applets[NUM_APPLETS] =
-{
-    {
-        IDI_USRMGR_ICON,
-        IDS_CPLNAME,
-        IDS_CPLDESCRIPTION,
-        UsrmgrApplet
-    }
-};
-
-
-static VOID
-InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
-{
-    ZeroMemory(psp, sizeof(PROPSHEETPAGE));
-    psp->dwSize = sizeof(PROPSHEETPAGE);
-    psp->dwFlags = PSP_DEFAULT;
-    psp->hInstance = hApplet;
-    psp->pszTemplate = MAKEINTRESOURCE(idDlg);
-    psp->pfnDlgProc = DlgProc;
-}
-
-
-/* Display Applet */
-static LONG APIENTRY
-UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
-{
-    PROPSHEETPAGE psp[3];
-    PROPSHEETHEADER psh;
-    TCHAR Caption[1024];
-
-    UNREFERENCED_PARAMETER(lParam);
-    UNREFERENCED_PARAMETER(wParam);
-    UNREFERENCED_PARAMETER(uMsg);
-
-    LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
-
-    ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
-    psh.dwSize = sizeof(PROPSHEETHEADER);
-    psh.dwFlags =  PSH_PROPSHEETPAGE;
-    psh.hwndParent = hwnd;
-    psh.hInstance = hApplet;
-    psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_USRMGR_ICON));
-    psh.pszCaption = Caption;
-    psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
-    psh.nStartPage = 0;
-    psh.ppsp = psp;
-
-    InitPropSheetPage(&psp[0], IDD_USERS, (DLGPROC)UsersPageProc);
-    InitPropSheetPage(&psp[1], IDD_GROUPS, (DLGPROC)GroupsPageProc);
-    InitPropSheetPage(&psp[2], IDD_EXTRA, (DLGPROC)ExtraPageProc);
-
-    return (LONG)(PropertySheet(&psh) != -1);
-}
-
-
-/* Control Panel Callback */
-LONG CALLBACK
-CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
-{
-    int i = (int)lParam1;
-
-    switch (uMsg)
-    {
-        case CPL_INIT:
-            return TRUE;
-
-        case CPL_GETCOUNT:
-            return NUM_APPLETS;
-
-        case CPL_INQUIRE:
-            {
-                CPLINFO *CPlInfo = (CPLINFO*)lParam2;
-                CPlInfo->lData = 0;
-                CPlInfo->idIcon = Applets[i].idIcon;
-                CPlInfo->idName = Applets[i].idName;
-                CPlInfo->idInfo = Applets[i].idDescription;
-            }
-            break;
-
-        case CPL_DBLCLK:
-            Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
-            break;
-    }
-
-    return FALSE;
-}
-
-
-BOOL WINAPI
-DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
-{
-    UNREFERENCED_PARAMETER(lpvReserved);
-
-    switch (dwReason)
-    {
-        case DLL_PROCESS_ATTACH:
-            hApplet = hinstDLL;
-            break;
-    }
-
-    return TRUE;
-}
+/* $Id$
+ *
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS User Manager Control Panel
+ * FILE:            dll/cpl/usrmgr/extra.c
+ * PURPOSE:         Main functions
+ *
+ * PROGRAMMERS:     Eric Kohl
+ */
+
+#include "usrmgr.h"
+
+#define NUM_APPLETS 1
+
+static LONG APIENTRY UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam);
+
+HINSTANCE hApplet = 0;
+
+/* Applets */
+APPLET Applets[NUM_APPLETS] =
+{
+    {
+        IDI_USRMGR_ICON,
+        IDS_CPLNAME,
+        IDS_CPLDESCRIPTION,
+        UsrmgrApplet
+    }
+};
+
+
+static VOID
+InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
+{
+    ZeroMemory(psp, sizeof(PROPSHEETPAGE));
+    psp->dwSize = sizeof(PROPSHEETPAGE);
+    psp->dwFlags = PSP_DEFAULT;
+    psp->hInstance = hApplet;
+    psp->pszTemplate = MAKEINTRESOURCE(idDlg);
+    psp->pfnDlgProc = DlgProc;
+}
+
+
+/* Display Applet */
+static LONG APIENTRY
+UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
+{
+    PROPSHEETPAGE psp[3];
+    PROPSHEETHEADER psh;
+    TCHAR Caption[1024];
+
+    UNREFERENCED_PARAMETER(lParam);
+    UNREFERENCED_PARAMETER(wParam);
+    UNREFERENCED_PARAMETER(uMsg);
+
+    LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
+
+    ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
+    psh.dwSize = sizeof(PROPSHEETHEADER);
+    psh.dwFlags =  PSH_PROPSHEETPAGE;
+    psh.hwndParent = hwnd;
+    psh.hInstance = hApplet;
+    psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_USRMGR_ICON));
+    psh.pszCaption = Caption;
+    psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
+    psh.nStartPage = 0;
+    psh.ppsp = psp;
+
+    InitPropSheetPage(&psp[0], IDD_USERS, (DLGPROC)UsersPageProc);
+    InitPropSheetPage(&psp[1], IDD_GROUPS, (DLGPROC)GroupsPageProc);
+    InitPropSheetPage(&psp[2], IDD_EXTRA, (DLGPROC)ExtraPageProc);
+
+    return (LONG)(PropertySheet(&psh) != -1);
+}
+
+
+/* Control Panel Callback */
+LONG CALLBACK
+CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
+{
+    int i = (int)lParam1;
+
+    switch (uMsg)
+    {
+        case CPL_INIT:
+            return TRUE;
+
+        case CPL_GETCOUNT:
+            return NUM_APPLETS;
+
+        case CPL_INQUIRE:
+            {
+                CPLINFO *CPlInfo = (CPLINFO*)lParam2;
+                CPlInfo->lData = 0;
+                CPlInfo->idIcon = Applets[i].idIcon;
+                CPlInfo->idName = Applets[i].idName;
+                CPlInfo->idInfo = Applets[i].idDescription;
+            }
+            break;
+
+        case CPL_DBLCLK:
+            Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
+            break;
+    }
+
+    return FALSE;
+}
+
+
+BOOL WINAPI
+DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
+{
+    UNREFERENCED_PARAMETER(lpvReserved);
+
+    switch (dwReason)
+    {
+        case DLL_PROCESS_ATTACH:
+            hApplet = hinstDLL;
+            break;
+    }
+
+    return TRUE;
+}

Propchange: trunk/reactos/dll/cpl/usrmgr/usrmgr.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/dll/cpl/usrmgr/usrmgr.def
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/usrmgr.def?rev=33790&r1=33789&r2=33790&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/usrmgr.def [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/usrmgr.def [iso-8859-1] Sat May 31 14:48:44 2008
@@ -1,6 +1,6 @@
-LIBRARY usrmgr.cpl
-
-EXPORTS
-CPlApplet at 16
-
-; EOF
+LIBRARY usrmgr.cpl
+
+EXPORTS
+CPlApplet at 16
+
+; EOF

Propchange: trunk/reactos/dll/cpl/usrmgr/usrmgr.def
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/dll/cpl/usrmgr/usrmgr.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/usrmgr.h?rev=33790&r1=33789&r2=33790&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/usrmgr.h [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/usrmgr.h [iso-8859-1] Sat May 31 14:48:44 2008
@@ -29,7 +29,14 @@
 INT_PTR CALLBACK GroupsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
 INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
 
+/* groupprops.c */
+VOID
+GroupProperties(HWND hwndDlg);
+
 /* misc.c */
+VOID
+DebugPrintf(LPTSTR szFormat, ...);
+
 BOOL
 CheckAccountName(HWND hwndDlg,
                  INT nIdDlgItem,

Modified: trunk/reactos/dll/cpl/usrmgr/usrmgr.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/usrmgr.rbuild?rev=33790&r1=33789&r2=33790&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/usrmgr.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/usrmgr/usrmgr.rbuild [iso-8859-1] Sat May 31 14:48:44 2008
@@ -14,6 +14,7 @@
 	<library>netapi32</library>
 	<library>msvcrt</library>
 	<file>extra.c</file>
+	<file>groupprops.c</file>
 	<file>groups.c</file>
 	<file>misc.c</file>
 	<file>userprops.c</file>



More information about the Ros-diffs mailing list