void Main_SetMenus (void) { HMENU hm = GetMenu (g.hMain); LPASIDLIST pSel = Display_GetSelectedList(); Main_SetViewMenus (hm); // Fix the Operations In Progress entry // CheckMenu (hm, M_ACTIONS, gr.fShowActions); // Fix the CellProperties and Edit.* menu items. Many get disabled if there // is no selection // BOOL fEnable = (pSel && pSel->cEntries) ? TRUE : FALSE; EnableMenu (hm, M_DELETE, fEnable); EnableMenu (hm, M_REFRESH, fEnable); EnableMenu (hm, M_MEMBERSHIP, fEnable); EnableMenu (hm, M_PROPERTIES, fEnable); if ((fEnable = (pSel && (pSel->cEntries == 1))) == TRUE) { // Make sure it's a group ASOBJTYPE Type; if (!asc_ObjectTypeGet_Fast (g.idClient, g.idCell, pSel->aEntries[0].idObject, &Type)) fEnable = FALSE; else if (Type != TYPE_GROUP) fEnable = FALSE; } EnableMenu (hm, M_RENAME, fEnable); if (pSel) asc_AsidListFree (&pSel); }
EXPORTED BOOL ADMINAPI AfsAppLib_asc_ObjectTypeGet_Fast (UINT_PTR idClient, ASID idCell, ASID idObject, ASOBJTYPE *pObjectType, ULONG *pStatus) { return asc_ObjectTypeGet_Fast (idClient, idCell, idObject, pObjectType, pStatus); }