ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static BOOL OnEndLabelEdit ( LPNMLVDISPINFO  pnmv) [static]

Definition at line 345 of file groups.c.

Referenced by OnNotify().

{
    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;
}

Generated on Sat May 26 2012 04:59:36 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.