Author: ekohl
Date: Tue Dec 25 14:41:08 2007
New Revision: 31429
URL:
http://svn.reactos.org/svn/reactos?rev=31429&view=rev
Log:
Create image lists for the groups and users list views and add images to the list view
items.
Modified:
trunk/reactos/dll/cpl/usrmgr/groups.c
trunk/reactos/dll/cpl/usrmgr/users.c
Modified: trunk/reactos/dll/cpl/usrmgr/groups.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/groups.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/usrmgr/groups.c (original)
+++ trunk/reactos/dll/cpl/usrmgr/groups.c Tue Dec 25 14:41:08 2007
@@ -70,10 +70,11 @@
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,8 +95,18 @@
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);
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 (original)
+++ trunk/reactos/dll/cpl/usrmgr/users.c Tue Dec 25 14:41:08 2007
@@ -141,10 +141,11 @@
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,9 +169,20 @@
OnInitDialog(HWND hwndDlg)
{
HWND hwndListView;
-
- /* Set user environment variables */
+ 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);
+
hwndListView = GetDlgItem(hwndDlg, IDC_USERS_LIST);
+
+ (VOID)ListView_SetImageList(hwndListView, hImgList, LVSIL_SMALL);
(void)ListView_SetExtendedListViewStyle(hwndListView, LVS_EX_FULLROWSELECT);