mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 05:01:03 +00:00
Create image lists for the groups and users list views and add images to the list view items.
svn path=/trunk/; revision=31429
This commit is contained in:
parent
73c4e223ec
commit
c60950760b
2 changed files with 26 additions and 3 deletions
|
@ -70,10 +70,11 @@ UpdateGroupsList(HWND hwndListView)
|
|||
for (i = 0; i < entriesread; i++)
|
||||
{
|
||||
memset(&lvi, 0x00, sizeof(lvi));
|
||||
lvi.mask = LVIF_TEXT | LVIF_STATE; // | LVIF_PARAM;
|
||||
lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE; // | LVIF_PARAM;
|
||||
// lvi.lParam = (LPARAM)VarData;
|
||||
lvi.pszText = pBuffer[i].lgrpi1_name;
|
||||
lvi.state = 0; //(i == 0) ? LVIS_SELECTED : 0;
|
||||
lvi.iImage = 0;
|
||||
iItem = ListView_InsertItem(hwndListView, &lvi);
|
||||
|
||||
ListView_SetItemText(hwndListView, iItem, 1,
|
||||
|
@ -94,9 +95,19 @@ 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);
|
||||
Index[0] = 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);
|
||||
|
|
|
@ -141,10 +141,11 @@ UpdateUsersList(HWND hwndListView)
|
|||
for (i = 0; i < entriesread; i++)
|
||||
{
|
||||
memset(&lvi, 0x00, sizeof(lvi));
|
||||
lvi.mask = LVIF_TEXT | LVIF_STATE; // | LVIF_PARAM;
|
||||
lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE; // | LVIF_PARAM;
|
||||
// lvi.lParam = (LPARAM)VarData;
|
||||
lvi.pszText = pBuffer[i].usri20_name;
|
||||
lvi.state = 0; //(i == 0) ? LVIS_SELECTED : 0;
|
||||
lvi.iImage = (pBuffer[i].usri20_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
|
||||
iItem = ListView_InsertItem(hwndListView, &lvi);
|
||||
|
||||
ListView_SetItemText(hwndListView, iItem, 1,
|
||||
|
@ -168,10 +169,21 @@ 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_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
|
||||
ImageList_AddIcon(hImgList, hIcon);
|
||||
hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_LOCKED_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
|
||||
ImageList_AddIcon(hImgList, hIcon);
|
||||
DestroyIcon(hIcon);
|
||||
|
||||
/* Set user environment variables */
|
||||
hwndListView = GetDlgItem(hwndDlg, IDC_USERS_LIST);
|
||||
|
||||
(VOID)ListView_SetImageList(hwndListView, hImgList, LVSIL_SMALL);
|
||||
|
||||
(void)ListView_SetExtendedListViewStyle(hwndListView, LVS_EX_FULLROWSELECT);
|
||||
|
||||
SetUsersListColumns(hwndListView);
|
||||
|
|
Loading…
Reference in a new issue