ReactOS 0.4.15-dev-7788-g1ad9096
listview.c
Go to the documentation of this file.
1/*
2 * Regedit listviews
3 *
4 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include "regedit.h"
22
23#define CX_ICON 16
24#define CY_ICON 16
25#define LISTVIEW_NUM_ICONS 2
26
28int Image_Bin = 0;
30
31typedef struct tagLINE_INFO
32{
35 void* val;
36 size_t val_len;
38
39typedef struct tagSORT_INFO
40{
44
45/*******************************************************************************
46 * Global and Local Variables:
47 */
48
50
51#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
52static const int default_column_widths[MAX_LIST_COLUMNS] = { 35, 25, 40 }; /* in percents */
54
55WCHAR *GetValueName(HWND hwndLV, int iStartAt)
56{
57 int item;
58 LVITEMW LVItem;
59 PLINE_INFO lineinfo;
60
61 /*
62 if a new item is inserted, then no allocation,
63 otherwise the heap block will be lost!
64 */
65 item = ListView_GetNextItem(hwndLV, iStartAt, LVNI_SELECTED);
66 if (item == -1) return NULL;
67
68 /*
69 Should be always TRUE anyways
70 */
71 LVItem.iItem = item;
72 LVItem.iSubItem = 0;
73 LVItem.mask = LVIF_PARAM;
74 if (ListView_GetItem(hwndLV, &LVItem) == FALSE)
75 return NULL;
76
77 lineinfo = (PLINE_INFO)LVItem.lParam;
78 if (lineinfo == NULL)
79 return NULL;
80
81 return lineinfo->name;
82}
83
84VOID SetValueName(HWND hwndLV, LPCWSTR pszValueName)
85{
86 INT i, c;
87 LVFINDINFOW fi;
88
89 c = ListView_GetItemCount(hwndLV);
90 for(i = 0; i < c; i++)
91 {
93 }
94 if (pszValueName == NULL || pszValueName[0] == 0)
95 i = 0;
96 else
97 {
98 fi.flags = LVFI_STRING;
99 fi.psz = pszValueName;
100 i = ListView_FindItem(hwndLV, -1, &fi);
101 }
106}
107
109{
110 PLINE_INFO lineinfo;
112
113 Item.mask = LVIF_PARAM;
114 Item.iItem = i;
115 if(ListView_GetItem(hwndLV, &Item))
116 {
117 lineinfo = (PLINE_INFO)Item.lParam;
118 return lineinfo && (!lineinfo->name || !wcscmp(lineinfo->name, L""));
119 }
120 return FALSE;
121}
122
123/*******************************************************************************
124 * Local module support methods
125 */
126static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void* ValBuf, DWORD dwCount, int Position, BOOL ValExists)
127{
128 PLINE_INFO linfo;
130 int index;
131
132 linfo = (PLINE_INFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LINE_INFO) + dwCount);
133 linfo->dwValType = dwValType;
134 linfo->val_len = dwCount;
135 if (dwCount > 0)
136 {
137 memcpy(&linfo[1], ValBuf, dwCount);
138 linfo->val = &linfo[1];
139 }
140 linfo->name = _wcsdup(Name);
141
143 item.iItem = (Position == -1 ? 0: Position);
144 item.iSubItem = 0;
145 item.state = 0;
146 item.stateMask = 0;
147 item.pszText = Name;
148 item.cchTextMax = (int)wcslen(item.pszText);
149 if (item.cchTextMax == 0)
150 item.pszText = LPSTR_TEXTCALLBACK;
151 item.iImage = 0;
152 item.lParam = (LPARAM)linfo;
153 switch(dwValType)
154 {
155 case REG_SZ:
156 case REG_EXPAND_SZ:
157 case REG_MULTI_SZ:
158 item.iImage = Image_String;
159 break;
160 default:
161 item.iImage = Image_Bin;
162 break;
163 }
164
165 /* item.lParam = (LPARAM)ValBuf; */
166#if (_WIN32_IE >= 0x0300)
167 item.iIndent = 0;
168#endif
169
170 index = ListView_InsertItem(hwndLV, &item);
171 if (index != -1)
172 {
173 switch (dwValType)
174 {
175 case REG_SZ:
176 case REG_EXPAND_SZ:
177 if(dwCount > 0)
178 {
179 ListView_SetItemText(hwndLV, index, 2, ValBuf);
180 }
181 else if(!ValExists)
182 {
183 WCHAR buffer[255];
184 /* load (value not set) string */
186 ListView_SetItemText(hwndLV, index, 2, buffer);
187 }
188 break;
189 case REG_MULTI_SZ:
190 {
191 LPWSTR src, str;
192 if(dwCount >= 2)
193 {
194 src = (LPWSTR)ValBuf;
195 str = HeapAlloc(GetProcessHeap(), 0, dwCount + sizeof(WCHAR));
196 if(str != NULL)
197 {
198 *str = L'\0';
199 /* concatenate all srings */
200 while(*src != L'\0')
201 {
202 wcscat(str, src);
203 wcscat(str, L" ");
204 src += wcslen(src) + 1;
205 }
206 ListView_SetItemText(hwndLV, index, 2, str);
208 }
209 else
210 ListView_SetItemText(hwndLV, index, 2, L"");
211 }
212 else
213 ListView_SetItemText(hwndLV, index, 2, L"");
214 }
215 break;
216 case REG_DWORD:
217 case REG_NONE:
218 {
219 WCHAR buf[200];
220 if(dwCount == sizeof(DWORD))
221 {
222 wsprintf(buf, L"0x%08x (%u)", *(DWORD*)ValBuf, *(DWORD*)ValBuf);
223 }
224 else
225 {
227 }
228 ListView_SetItemText(hwndLV, index, 2, buf);
229 }
230 /* lpsRes = convertHexToDWORDStr(lpbData, dwLen); */
231 break;
232 default:
233 {
234 unsigned int i;
235 LPBYTE pData = (LPBYTE)ValBuf;
236 LPWSTR strBinary;
237 if(dwCount > 0)
238 {
239 strBinary = HeapAlloc(GetProcessHeap(), 0, (dwCount * sizeof(WCHAR) * 3) + sizeof(WCHAR));
240 for (i = 0; i < dwCount; i++)
241 {
242 wsprintf( strBinary + i*3, L"%02X ", pData[i] );
243 }
244 strBinary[dwCount * 3] = 0;
245 ListView_SetItemText(hwndLV, index, 2, strBinary);
246 HeapFree(GetProcessHeap(), 0, strBinary);
247 }
248 else
249 {
250 WCHAR szText[128];
251 LoadStringW(hInst, IDS_BINARY_EMPTY, szText, ARRAY_SIZE(szText));
252 ListView_SetItemText(hwndLV, index, 2, szText);
253 }
254 }
255 break;
256 }
257 }
258}
259
260static BOOL CreateListColumns(HWND hWndListView, INT cxTotal)
261{
262 WCHAR szText[50];
263 int index;
264 LVCOLUMN lvC;
265
266 /* Create columns. */
267 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
268 lvC.pszText = szText;
269
270 /* Load the column labels from the resource file. */
271 for (index = 0; index < MAX_LIST_COLUMNS; index++)
272 {
273 lvC.iSubItem = index;
274 lvC.cx = (cxTotal * default_column_widths[index]) / 100;
275 lvC.fmt = column_alignment[index];
277 if (ListView_InsertColumn(hWndListView, index, &lvC) == -1) return FALSE;
278 }
279 return TRUE;
280}
281
283{
284 HIMAGELIST himl; /* handle to image list */
285 HICON hico; /* handle to icon */
286
287 /* Create the image list. */
290 {
291 return FALSE;
292 }
293
296
299
300 /* Fail if not all of the images were added. */
302 {
303 return FALSE;
304 }
305
306 /* Associate the image list with the tree view control. */
308
309 return TRUE;
310}
311
312/* OnGetDispInfo - processes the LVN_GETDISPINFO notification message. */
313
314static void OnGetDispInfo(NMLVDISPINFO* plvdi)
315{
316 static WCHAR buffer[200];
317
318 plvdi->item.pszText = NULL;
319 plvdi->item.cchTextMax = 0;
320
321 switch (plvdi->item.iSubItem)
322 {
323 case 0:
325 plvdi->item.pszText = buffer;
326 break;
327 case 1:
328 switch (((LINE_INFO*)plvdi->item.lParam)->dwValType)
329 {
330 case REG_NONE:
331 plvdi->item.pszText = L"REG_NONE";
332 break;
333 case REG_SZ:
334 plvdi->item.pszText = L"REG_SZ";
335 break;
336 case REG_EXPAND_SZ:
337 plvdi->item.pszText = L"REG_EXPAND_SZ";
338 break;
339 case REG_BINARY:
340 plvdi->item.pszText = L"REG_BINARY";
341 break;
342 case REG_DWORD: /* REG_DWORD_LITTLE_ENDIAN */
343 plvdi->item.pszText = L"REG_DWORD";
344 break;
346 plvdi->item.pszText = L"REG_DWORD_BIG_ENDIAN";
347 break;
348 case REG_LINK:
349 plvdi->item.pszText = L"REG_LINK";
350 break;
351 case REG_MULTI_SZ:
352 plvdi->item.pszText = L"REG_MULTI_SZ";
353 break;
355 plvdi->item.pszText = L"REG_RESOURCE_LIST";
356 break;
358 plvdi->item.pszText = L"REG_FULL_RESOURCE_DESCRIPTOR";
359 break;
361 plvdi->item.pszText = L"REG_RESOURCE_REQUIREMENTS_LIST";
362 break;
363 case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
364 plvdi->item.pszText = L"REG_QWORD";
365 break;
366 default:
367 {
368 WCHAR buf2[200];
370 wsprintf(buffer, buf2, ((LINE_INFO*)plvdi->item.lParam)->dwValType);
371 plvdi->item.pszText = buffer;
372 break;
373 }
374 }
375 break;
376 case 3:
377 plvdi->item.pszText = L"";
378 break;
379 }
380}
381
382static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
383{
384 PSORT_INFO pSortInfo = (PSORT_INFO)lParamSort;
385 LINE_INFO *l, *r;
386 DWORD dw1, dw2;
387 DWORDLONG qw1, qw2;
388
389 l = (LINE_INFO*)lParam1;
390 r = (LINE_INFO*)lParam2;
391
392 if (pSortInfo->iSortingColumn == 1 && l->dwValType != r->dwValType)
393 {
394 /* Sort by type */
395 if (pSortInfo->bSortAscending)
396 return ((int)l->dwValType - (int)r->dwValType);
397 else
398 return ((int)r->dwValType - (int)l->dwValType);
399 }
400 if (pSortInfo->iSortingColumn == 2)
401 {
402 /* Sort by value */
403 if (l->dwValType != r->dwValType)
404 {
405 if (pSortInfo->bSortAscending)
406 return ((int)l->dwValType - (int)r->dwValType);
407 else
408 return ((int)r->dwValType - (int)l->dwValType);
409 }
410
411 if (l->val == NULL && r->val == NULL)
412 return 0;
413
414 if (pSortInfo->bSortAscending)
415 {
416 if (l->val == NULL)
417 return -1;
418 if (r->val == NULL)
419 return 1;
420 }
421 else
422 {
423 if (l->val == NULL)
424 return 1;
425 if (r->val == NULL)
426 return -1;
427 }
428
429 switch(l->dwValType)
430 {
431 case REG_DWORD:
432 {
433 dw1 = *(DWORD*)l->val;
434 dw2 = *(DWORD*)r->val;
435 if (pSortInfo->bSortAscending)
436 // return (dw1 > dw2 ? 1 : -1);
437 return ((int)dw1 - (int)dw2);
438 else
439 // return (dw1 > dw2 ? -1 : 1);
440 return ((int)dw2 - (int)dw1);
441 }
442
443 case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
444 {
445 qw1 = *(DWORDLONG*)l->val;
446 qw2 = *(DWORDLONG*)r->val;
447 if (pSortInfo->bSortAscending)
448 // return (qw1 > qw2 ? 1 : -1);
449 return ((int)qw1 - (int)qw2);
450 else
451 // return (qw1 > qw2 ? -1 : 1);
452 return ((int)qw2 - (int)qw1);
453 }
454
455 default:
456 {
457 INT nCompare = 0;
458
459 if (pSortInfo->bSortAscending)
460 {
461 nCompare = memcmp(l->val, r->val, min(l->val_len, r->val_len));
462 if (nCompare == 0)
463 nCompare = l->val_len - r->val_len;
464 }
465 else
466 {
467 nCompare = memcmp(r->val, l->val, min(r->val_len, l->val_len));
468 if (nCompare == 0)
469 nCompare = r->val_len - l->val_len;
470 }
471
472 return nCompare;
473 }
474 }
475 }
476
477 /* Sort by name */
478 return (pSortInfo->bSortAscending ? StrCmpLogicalW(l->name, r->name) : StrCmpLogicalW(r->name, l->name));
479}
480
481static BOOL ListView_Sort(HWND hListView, int iSortingColumn, int iSortedColumn)
482{
483 if (!(GetWindowLongPtr(hListView, GWL_STYLE) & LVS_NOSORTHEADER) &&
484 (iSortingColumn >= 0) )
485 {
487 SORT_INFO SortInfo;
488
489 HWND hHeader = ListView_GetHeader(hListView);
490 HDITEM hColumn = {0};
491
492 /* If we are sorting according to another column, uninitialize the old one */
493 if ( (iSortedColumn >= 0) && (iSortingColumn != iSortedColumn) )
494 {
495 hColumn.mask = HDI_FORMAT;
496 Header_GetItem(hHeader, iSortedColumn, &hColumn);
497 hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
498 Header_SetItem(hHeader, iSortedColumn, &hColumn);
499 }
500
501 /* Get the sorting state of the new column */
502 hColumn.mask = HDI_FORMAT;
503 Header_GetItem(hHeader, iSortingColumn, &hColumn);
504
505 /*
506 * Check whether we are sorting the list because the user clicked
507 * on a column, or because we are refreshing the list:
508 *
509 * iSortedColumn >= 0 - User clicked on a column; holds the
510 * old sorting column index.
511 * iSortedColumn < 0 - List being refreshed.
512 */
513 if (iSortedColumn >= 0)
514 {
515 /* Invert the sorting direction */
516 bSortAscending = ((hColumn.fmt & HDF_SORTUP) == 0);
517 }
518 else
519 {
520 /*
521 * If the sorting state of the column is uninitialized,
522 * initialize it by default to ascending sorting.
523 */
524 if ((hColumn.fmt & (HDF_SORTUP | HDF_SORTDOWN)) == 0)
525 hColumn.fmt |= HDF_SORTUP;
526
527 /* Keep the same sorting direction */
528 bSortAscending = ((hColumn.fmt & HDF_SORTUP) != 0);
529 }
530
531 /* Set the new column sorting state */
532 hColumn.fmt &= ~(bSortAscending ? HDF_SORTDOWN : HDF_SORTUP );
533 hColumn.fmt |= (bSortAscending ? HDF_SORTUP : HDF_SORTDOWN);
534 Header_SetItem(hHeader, iSortingColumn, &hColumn);
535
536 /* Sort the list */
537 SortInfo.iSortingColumn = iSortingColumn;
539 return ListView_SortItems(hListView, CompareFunc, (LPARAM)&SortInfo);
540 }
541 else
542 return TRUE;
543}
544
546{
548 int iSortingColumn;
550 *Result = TRUE;
551 switch (((LPNMHDR)lParam)->code)
552 {
553 case LVN_GETDISPINFO:
555 return TRUE;
556 case LVN_COLUMNCLICK:
557 iSortingColumn = ((LPNMLISTVIEW)lParam)->iSubItem;
558 (void)ListView_Sort(hWnd, iSortingColumn, g_iSortedColumn);
559 g_iSortedColumn = iSortingColumn;
560 return TRUE;
561 case NM_DBLCLK:
562 case NM_RETURN:
563 {
565 }
566 return TRUE;
567 case NM_SETFOCUS:
569 break;
572 if(Info)
573 {
574 PLINE_INFO lineinfo = (PLINE_INFO)Info->item.lParam;
575 if(!lineinfo->name || !wcscmp(lineinfo->name, L""))
576 {
577 *Result = TRUE;
578 }
579 else
580 {
581 *Result = FALSE;
582 }
583 }
584 else
585 *Result = TRUE;
586 return TRUE;
587 case LVN_ENDLABELEDIT:
589 if(Info && Info->item.pszText)
590 {
591 PLINE_INFO lineinfo = (PLINE_INFO)Info->item.lParam;
592 if(!lineinfo->name || !wcscmp(lineinfo->name, L""))
593 {
594 *Result = FALSE;
595 }
596 else
597 {
598 if(wcslen(Info->item.pszText) == 0)
599 {
600 WCHAR msg[128], caption[128];
601
604 MessageBoxW(0, msg, caption, 0);
605 *Result = TRUE;
606 }
607 else
608 {
609 HKEY hKeyRoot;
610 LPCWSTR keyPath;
611 LONG lResult;
612
613 keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
614 lResult = RenameValue(hKeyRoot, keyPath, Info->item.pszText, lineinfo->name);
615 lineinfo->name = realloc(lineinfo->name, (wcslen(Info->item.pszText)+1)*sizeof(WCHAR));
616 if (lineinfo->name != NULL)
617 wcscpy(lineinfo->name, Info->item.pszText);
618
619 *Result = TRUE;
620 return (lResult == ERROR_SUCCESS);
621 }
622 }
623 }
624 else
625 *Result = TRUE;
626
627 return TRUE;
628 }
629 return FALSE;
630}
631
633{
634 RECT rcClient;
635 HWND hwndLV;
636
637 /* Get the dimensions of the parent window's client area, and create the list view control. */
638 GetClientRect(hwndParent, &rcClient);
639 hwndLV = CreateWindowExW(WS_EX_CLIENTEDGE, WC_LISTVIEW, L"List View",
641 0, 0, rcClient.right, rcClient.bottom,
642 hwndParent, id, hInst, NULL);
643 if (!hwndLV) return NULL;
644
645 /* Initialize the image list, and add items to the control. */
646 if (!CreateListColumns(hwndLV, cx)) goto fail;
647 if (!InitListViewImageLists(hwndLV)) goto fail;
648
649 return hwndLV;
650fail:
651 DestroyWindow(hwndLV);
652 return NULL;
653}
654
656{
657 INT count, i;
659
661 for (i = 0; i < count; i++)
662 {
663 item.mask = LVIF_PARAM;
664 item.iItem = i;
665 (void)ListView_GetItem(hwndLV, &item);
666 free(((LINE_INFO*)item.lParam)->name);
667 HeapFree(GetProcessHeap(), 0, (void*)item.lParam);
668 }
669
670}
671
672BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath, BOOL bSelectNone)
673{
674 DWORD max_sub_key_len;
675 DWORD max_val_name_len;
676 DWORD max_val_size;
677 DWORD val_count;
678 HKEY hNewKey;
679 LONG errCode;
680 INT i, c;
681 BOOL AddedDefault = FALSE;
682
683 if (!hwndLV) return FALSE;
684
685 (void)ListView_EditLabel(hwndLV, -1);
686
687 SendMessageW(hwndLV, WM_SETREDRAW, FALSE, 0);
688 DestroyListView(hwndLV);
689
691
692 if(!hKey) return FALSE;
693
694 errCode = RegOpenKeyExW(hKey, keyPath, 0, KEY_READ, &hNewKey);
695 if (errCode != ERROR_SUCCESS) return FALSE;
696
697 /* get size information and resize the buffers if necessary */
698 errCode = RegQueryInfoKeyW(hNewKey, NULL, NULL, NULL, NULL, &max_sub_key_len, NULL,
699 &val_count, &max_val_name_len, &max_val_size, NULL, NULL);
700
701 if (errCode == ERROR_SUCCESS)
702 {
703 WCHAR* ValName = HeapAlloc(GetProcessHeap(), 0, ++max_val_name_len * sizeof(WCHAR));
704 DWORD dwValNameLen = max_val_name_len;
705 BYTE* ValBuf = HeapAlloc(GetProcessHeap(), 0, max_val_size + sizeof(WCHAR));
706 DWORD dwValSize = max_val_size;
707 DWORD dwIndex = 0L;
708 DWORD dwValType;
709 /* if (RegQueryValueExW(hNewKey, NULL, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS) { */
710 /* AddEntryToList(hwndLV, L"(Default)", dwValType, ValBuf, dwValSize); */
711 /* } */
712 /* dwValSize = max_val_size; */
713 while (RegEnumValueW(hNewKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS)
714 {
715 /* Add a terminating 0 character. Usually this is only necessary for strings. */
716 ValBuf[dwValSize] = ValBuf[dwValSize + 1] = 0;
717
718 AddEntryToList(hwndLV, ValName, dwValType, ValBuf, dwValSize, -1, TRUE);
719 dwValNameLen = max_val_name_len;
720 dwValSize = max_val_size;
721 dwValType = 0L;
722 ++dwIndex;
723 if(!wcscmp(ValName, L""))
724 {
725 AddedDefault = TRUE;
726 }
727 }
728 HeapFree(GetProcessHeap(), 0, ValBuf);
729 HeapFree(GetProcessHeap(), 0, ValName);
730 }
731 RegCloseKey(hNewKey);
732
733 if(!AddedDefault)
734 {
735 AddEntryToList(hwndLV, L"", REG_SZ, NULL, 0, 0, FALSE);
736 }
737 c = ListView_GetItemCount(hwndLV);
738 for(i = 0; i < c; i++)
739 {
741 }
742
743 if (bSelectNone)
744 iListViewSelect = -1;
748 (void)ListView_Sort(hwndLV, g_iSortedColumn, -1);
749 SendMessageW(hwndLV, WM_SETREDRAW, TRUE, 0);
750
751 return TRUE;
752}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
struct NameRec_ * Name
Definition: cdprocs.h:460
static BOOL bSortAscending
Definition: applpage.c:27
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
BOOL CreateListView(PMAIN_WND_INFO Info)
Definition: listview.c:355
#define index(s, c)
Definition: various.h:29
ChildWnd * g_pChildWnd
Definition: childwnd.c:23
LONG RenameValue(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpDestValue, LPCWSTR lpSrcValue)
Definition: edit.c:2140
BOOL IsDefaultValue(HWND hwndLV, int i)
Definition: listview.c:108
static BOOL CreateListColumns(HWND hWndListView, INT cxTotal)
Definition: listview.c:260
static BOOL InitListViewImageLists(HWND hwndLV)
Definition: listview.c:282
VOID SetValueName(HWND hwndLV, LPCWSTR pszValueName)
Definition: listview.c:84
#define MAX_LIST_COLUMNS
Definition: listview.c:51
static void OnGetDispInfo(NMLVDISPINFO *plvdi)
Definition: listview.c:314
#define LISTVIEW_NUM_ICONS
Definition: listview.c:25
BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath, BOOL bSelectNone)
Definition: listview.c:672
static const int column_alignment[MAX_LIST_COLUMNS]
Definition: listview.c:53
BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
Definition: listview.c:545
static INT g_iSortedColumn
Definition: listview.c:49
struct tagLINE_INFO LINE_INFO
int Image_String
Definition: listview.c:27
INT iListViewSelect
Definition: listview.c:29
struct tagSORT_INFO SORT_INFO
static const int default_column_widths[MAX_LIST_COLUMNS]
Definition: listview.c:52
#define CX_ICON
Definition: listview.c:23
struct tagLINE_INFO * PLINE_INFO
int Image_Bin
Definition: listview.c:28
struct tagSORT_INFO * PSORT_INFO
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: listview.c:382
static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void *ValBuf, DWORD dwCount, int Position, BOOL ValExists)
Definition: listview.c:126
WCHAR * GetValueName(HWND hwndLV, int iStartAt)
Definition: listview.c:55
void DestroyListView(HWND hwndLV)
Definition: listview.c:655
#define CY_ICON
Definition: listview.c:24
HWND hFrameWnd
Definition: main.c:35
#define ARRAY_SIZE(A)
Definition: main.h:33
LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY *phRootKey)
Definition: treeview.c:88
#define IDS_BINARY_EMPTY
Definition: resource.h:125
#define IDS_ERR_RENVAL_CAPTION
Definition: resource.h:138
#define IDI_STRING
Definition: resource.h:43
#define IDS_VALUE_NOT_SET
Definition: resource.h:127
#define ID_EDIT_MODIFY
Definition: resource.h:62
#define IDS_DEFAULT_VALUE_NAME
Definition: resource.h:126
#define IDS_LIST_COLUMN_FIRST
Definition: resource.h:29
#define IDS_UNKNOWN_TYPE
Definition: resource.h:128
#define IDI_BIN
Definition: resource.h:44
#define IDS_INVALID_DWORD
Definition: resource.h:132
#define IDS_ERR_RENVAL_TOEMPTY
Definition: resource.h:139
#define RegCloseKey(hKey)
Definition: registry.h:49
HICON hico
HIMAGELIST himl
r l[0]
Definition: byte_order.h:168
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static HWND hwndParent
Definition: cryptui.c:300
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3362
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2859
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3691
INT WINAPI ImageList_GetImageCount(HIMAGELIST himl)
Definition: imagelist.c:2063
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
INT WINAPI StrCmpLogicalW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:2296
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
GLuint index
Definition: glext.h:6031
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
unsigned long long DWORDLONG
Definition: intsafe.h:93
#define c
Definition: ke_i.h:80
#define REG_SZ
Definition: layer.c:22
if(dx< 0)
Definition: linetemp.h:194
#define ListView_Sort(hListView, iSortingColumn)
Definition: listview.h:32
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HICON
Definition: imagelist.c:84
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static ATOM item
Definition: dde.c:856
#define min(a, b)
Definition: monoChain.cc:55
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
#define REG_DWORD_BIG_ENDIAN
Definition: nt_native.h:1499
#define REG_RESOURCE_LIST
Definition: nt_native.h:1502
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define REG_RESOURCE_REQUIREMENTS_LIST
Definition: nt_native.h:1504
#define REG_LINK
Definition: nt_native.h:1500
#define REG_NONE
Definition: nt_native.h:1492
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define REG_FULL_RESOURCE_DESCRIPTOR
Definition: nt_native.h:1503
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define L(x)
Definition: ntvdm.h:50
#define WS_CHILD
Definition: pedump.c:617
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:751
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2673
#define LVFI_STRING
Definition: commctrl.h:2437
#define LVN_COLUMNCLICK
Definition: commctrl.h:3139
#define ListView_EditLabel(hwndLV, i)
Definition: commctrl.h:2540
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2636
#define NM_DBLCLK
Definition: commctrl.h:131
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2304
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:758
#define LVNI_SELECTED
Definition: commctrl.h:2424
#define ListView_GetHeader(hwnd)
Definition: commctrl.h:2651
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2267
#define LVS_REPORT
Definition: commctrl.h:2262
#define LVN_GETDISPINFO
Definition: commctrl.h:3160
#define LVN_ENDLABELEDIT
Definition: commctrl.h:3159
#define LVCF_WIDTH
Definition: commctrl.h:2587
_Out_opt_ int * cx
Definition: commctrl.h:585
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2434
#define NMLVDISPINFO
Definition: commctrl.h:3182
#define LPSTR_TEXTCALLBACK
Definition: commctrl.h:2383
#define HDF_SORTUP
Definition: commctrl.h:724
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2307
#define LVN_BEGINLABELEDIT
Definition: commctrl.h:3158
#define ListView_SortItems(hwndLV, _pfnCompare, _lPrm)
Definition: commctrl.h:2703
#define LVIS_SELECTED
Definition: commctrl.h:2319
#define NM_RETURN
Definition: commctrl.h:132
#define LVIF_PARAM
Definition: commctrl.h:2311
#define WC_LISTVIEW
Definition: commctrl.h:2259
#define HDI_FORMAT
Definition: commctrl.h:705
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVS_NOSORTHEADER
Definition: commctrl.h:2285
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2414
#define LVS_EDITLABELS
Definition: commctrl.h:2273
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2691
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVCF_FMT
Definition: commctrl.h:2586
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define NM_SETFOCUS
Definition: commctrl.h:135
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define ILC_MASK
Definition: commctrl.h:351
#define LVIF_IMAGE
Definition: commctrl.h:2310
#define LVCF_TEXT
Definition: commctrl.h:2588
#define HDITEM
Definition: commctrl.h:697
#define LVIS_FOCUSED
Definition: commctrl.h:2318
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2394
#define HDF_SORTDOWN
Definition: commctrl.h:725
#define ListView_FindItem(hwnd, iStart, plvfi)
Definition: commctrl.h:2470
#define LVCOLUMN
Definition: commctrl.h:2581
#define ListView_EnsureVisible(hwndLV, i, fPartialOK)
Definition: commctrl.h:2519
const WCHAR * str
#define REG_QWORD
Definition: sdbapi.c:597
#define REG_DWORD
Definition: sdbapi.c:596
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static int iSortedColumn
Definition: srvpage.cpp:27
int nFocusPanel
Definition: main.h:68
HWND hTreeWnd
Definition: main.h:63
Definition: inflate.c:139
DWORD dwValType
Definition: listview.c:33
void * val
Definition: listview.c:35
LPWSTR name
Definition: listview.c:34
size_t val_len
Definition: listview.c:36
LPCWSTR psz
Definition: commctrl.h:2457
int iSubItem
Definition: commctrl.h:2362
UINT mask
Definition: commctrl.h:2360
LPARAM lParam
Definition: commctrl.h:2368
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
BOOL bSortAscending
Definition: listview.c:42
INT iSortingColumn
Definition: listview.c:41
static COORD Position
Definition: mouse.c:34
#define GetWindowLongPtr
Definition: treelist.c:73
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define MAKEWPARAM(l, h)
Definition: winuser.h:4009
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define WM_COMMAND
Definition: winuser.h:1740
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define wsprintf
Definition: winuser.h:5865
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define GWL_STYLE
Definition: winuser.h:852
BOOL WINAPI DestroyWindow(_In_ HWND)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETREDRAW
Definition: winuser.h:1616
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193