ReactOS  0.4.14-dev-115-g4576127
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 
27 int Image_String = 0;
28 int Image_Bin = 0;
30 
31 typedef struct tagLINE_INFO
32 {
35  void* val;
36  size_t val_len;
38 
39 typedef struct tagSORT_INFO
40 {
44 
45 /*******************************************************************************
46  * Global and Local Variables:
47  */
48 
49 static INT g_iSortedColumn = 0;
50 
51 #define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
52 static const int default_column_widths[MAX_LIST_COLUMNS] = { 35, 25, 40 }; /* in percents */
54 
55 LPCWSTR 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 
84 VOID 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)
95  i = 0;
96  else
97  {
98  fi.flags = LVFI_STRING;
99  fi.psz = pszValueName;
100  i = ListView_FindItem(hwndLV, -1, &fi);
101  }
104  iListViewSelect = i;
105 }
106 
107 BOOL IsDefaultValue(HWND hwndLV, int i)
108 {
109  PLINE_INFO lineinfo;
110  LVITEMW Item;
111 
112  Item.mask = LVIF_PARAM;
113  Item.iItem = i;
114  if(ListView_GetItem(hwndLV, &Item))
115  {
116  lineinfo = (PLINE_INFO)Item.lParam;
117  return lineinfo && (!lineinfo->name || !wcscmp(lineinfo->name, L""));
118  }
119  return FALSE;
120 }
121 
122 /*******************************************************************************
123  * Local module support methods
124  */
125 static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void* ValBuf, DWORD dwCount, int Position, BOOL ValExists)
126 {
127  PLINE_INFO linfo;
128  LVITEMW item;
129  int index;
130 
131  linfo = (PLINE_INFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LINE_INFO) + dwCount);
132  linfo->dwValType = dwValType;
133  linfo->val_len = dwCount;
134  if (dwCount > 0)
135  {
136  memcpy(&linfo[1], ValBuf, dwCount);
137  linfo->val = &linfo[1];
138  }
139  linfo->name = _wcsdup(Name);
140 
141  item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
142  item.iItem = (Position == -1 ? 0: Position);
143  item.iSubItem = 0;
144  item.state = 0;
145  item.stateMask = 0;
146  item.pszText = Name;
147  item.cchTextMax = (int)wcslen(item.pszText);
148  if (item.cchTextMax == 0)
149  item.pszText = LPSTR_TEXTCALLBACK;
150  item.iImage = 0;
151  item.lParam = (LPARAM)linfo;
152  switch(dwValType)
153  {
154  case REG_SZ:
155  case REG_EXPAND_SZ:
156  case REG_MULTI_SZ:
157  item.iImage = Image_String;
158  break;
159  default:
160  item.iImage = Image_Bin;
161  break;
162  }
163 
164  /* item.lParam = (LPARAM)ValBuf; */
165 #if (_WIN32_IE >= 0x0300)
166  item.iIndent = 0;
167 #endif
168 
169  index = ListView_InsertItem(hwndLV, &item);
170  if (index != -1)
171  {
172  switch (dwValType)
173  {
174  case REG_SZ:
175  case REG_EXPAND_SZ:
176  if(dwCount > 0)
177  {
178  ListView_SetItemText(hwndLV, index, 2, ValBuf);
179  }
180  else if(!ValExists)
181  {
182  WCHAR buffer[255];
183  /* load (value not set) string */
185  ListView_SetItemText(hwndLV, index, 2, buffer);
186  }
187  break;
188  case REG_MULTI_SZ:
189  {
190  LPWSTR src, str;
191  if(dwCount >= 2)
192  {
193  src = (LPWSTR)ValBuf;
194  str = HeapAlloc(GetProcessHeap(), 0, dwCount + sizeof(WCHAR));
195  if(str != NULL)
196  {
197  *str = L'\0';
198  /* concatenate all srings */
199  while(*src != L'\0')
200  {
201  wcscat(str, src);
202  wcscat(str, L" ");
203  src += wcslen(src) + 1;
204  }
205  ListView_SetItemText(hwndLV, index, 2, str);
206  HeapFree(GetProcessHeap(), 0, str);
207  }
208  else
209  ListView_SetItemText(hwndLV, index, 2, L"");
210  }
211  else
212  ListView_SetItemText(hwndLV, index, 2, L"");
213  }
214  break;
215  case REG_DWORD:
216  {
217  WCHAR buf[200];
218  if(dwCount == sizeof(DWORD))
219  {
220  wsprintf(buf, L"0x%08x (%u)", *(DWORD*)ValBuf, *(DWORD*)ValBuf);
221  }
222  else
223  {
225  }
226  ListView_SetItemText(hwndLV, index, 2, buf);
227  }
228  /* lpsRes = convertHexToDWORDStr(lpbData, dwLen); */
229  break;
230  default:
231  {
232  unsigned int i;
233  LPBYTE pData = (LPBYTE)ValBuf;
234  LPWSTR strBinary;
235  if(dwCount > 0)
236  {
237  strBinary = HeapAlloc(GetProcessHeap(), 0, (dwCount * sizeof(WCHAR) * 3) + sizeof(WCHAR));
238  for (i = 0; i < dwCount; i++)
239  {
240  wsprintf( strBinary + i*3, L"%02X ", pData[i] );
241  }
242  strBinary[dwCount * 3] = 0;
243  ListView_SetItemText(hwndLV, index, 2, strBinary);
244  HeapFree(GetProcessHeap(), 0, strBinary);
245  }
246  else
247  {
248  WCHAR szText[128];
250  ListView_SetItemText(hwndLV, index, 2, szText);
251  }
252  }
253  break;
254  }
255  }
256 }
257 
258 static BOOL CreateListColumns(HWND hWndListView, INT cxTotal)
259 {
260  WCHAR szText[50];
261  int index;
262  LVCOLUMN lvC;
263 
264  /* Create columns. */
265  lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
266  lvC.pszText = szText;
267 
268  /* Load the column labels from the resource file. */
269  for (index = 0; index < MAX_LIST_COLUMNS; index++)
270  {
271  lvC.iSubItem = index;
272  lvC.cx = (cxTotal * default_column_widths[index]) / 100;
273  lvC.fmt = column_alignment[index];
275  if (ListView_InsertColumn(hWndListView, index, &lvC) == -1) return FALSE;
276  }
277  return TRUE;
278 }
279 
281 {
282  HIMAGELIST himl; /* handle to image list */
283  HICON hico; /* handle to icon */
284 
285  /* Create the image list. */
288  {
289  return FALSE;
290  }
291 
294 
297 
298  /* Fail if not all of the images were added. */
300  {
301  return FALSE;
302  }
303 
304  /* Associate the image list with the tree view control. */
306 
307  return TRUE;
308 }
309 
310 /* OnGetDispInfo - processes the LVN_GETDISPINFO notification message. */
311 
312 static void OnGetDispInfo(NMLVDISPINFO* plvdi)
313 {
314  static WCHAR buffer[200];
315 
316  plvdi->item.pszText = NULL;
317  plvdi->item.cchTextMax = 0;
318 
319  switch (plvdi->item.iSubItem)
320  {
321  case 0:
323  plvdi->item.pszText = buffer;
324  break;
325  case 1:
326  switch (((LINE_INFO*)plvdi->item.lParam)->dwValType)
327  {
328  case REG_NONE:
329  plvdi->item.pszText = L"REG_NONE";
330  break;
331  case REG_SZ:
332  plvdi->item.pszText = L"REG_SZ";
333  break;
334  case REG_EXPAND_SZ:
335  plvdi->item.pszText = L"REG_EXPAND_SZ";
336  break;
337  case REG_BINARY:
338  plvdi->item.pszText = L"REG_BINARY";
339  break;
340  case REG_DWORD: /* REG_DWORD_LITTLE_ENDIAN */
341  plvdi->item.pszText = L"REG_DWORD";
342  break;
344  plvdi->item.pszText = L"REG_DWORD_BIG_ENDIAN";
345  break;
346  case REG_LINK:
347  plvdi->item.pszText = L"REG_LINK";
348  break;
349  case REG_MULTI_SZ:
350  plvdi->item.pszText = L"REG_MULTI_SZ";
351  break;
352  case REG_RESOURCE_LIST:
353  plvdi->item.pszText = L"REG_RESOURCE_LIST";
354  break;
356  plvdi->item.pszText = L"REG_FULL_RESOURCE_DESCRIPTOR";
357  break;
359  plvdi->item.pszText = L"REG_RESOURCE_REQUIREMENTS_LIST";
360  break;
361  case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
362  plvdi->item.pszText = L"REG_QWORD";
363  break;
364  default:
365  {
366  WCHAR buf2[200];
368  wsprintf(buffer, buf2, ((LINE_INFO*)plvdi->item.lParam)->dwValType);
369  plvdi->item.pszText = buffer;
370  break;
371  }
372  }
373  break;
374  case 3:
375  plvdi->item.pszText = L"";
376  break;
377  }
378 }
379 
380 static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
381 {
382  PSORT_INFO pSortInfo = (PSORT_INFO)lParamSort;
383  LINE_INFO *l, *r;
384  DWORD dw1, dw2;
385  DWORDLONG qw1, qw2;
386 
387  l = (LINE_INFO*)lParam1;
388  r = (LINE_INFO*)lParam2;
389 
390  if (pSortInfo->iSortingColumn == 1 && l->dwValType != r->dwValType)
391  {
392  /* Sort by type */
393  if (pSortInfo->bSortAscending)
394  return ((int)l->dwValType - (int)r->dwValType);
395  else
396  return ((int)r->dwValType - (int)l->dwValType);
397  }
398  if (pSortInfo->iSortingColumn == 2)
399  {
400  /* Sort by value */
401  if (l->dwValType != r->dwValType)
402  {
403  if (pSortInfo->bSortAscending)
404  return ((int)l->dwValType - (int)r->dwValType);
405  else
406  return ((int)r->dwValType - (int)l->dwValType);
407  }
408 
409  if (l->val == NULL && r->val == NULL)
410  return 0;
411 
412  if (pSortInfo->bSortAscending)
413  {
414  if (l->val == NULL)
415  return -1;
416  if (r->val == NULL)
417  return 1;
418  }
419  else
420  {
421  if (l->val == NULL)
422  return 1;
423  if (r->val == NULL)
424  return -1;
425  }
426 
427  switch(l->dwValType)
428  {
429  case REG_DWORD:
430  {
431  dw1 = *(DWORD*)l->val;
432  dw2 = *(DWORD*)r->val;
433  if (pSortInfo->bSortAscending)
434  // return (dw1 > dw2 ? 1 : -1);
435  return ((int)dw1 - (int)dw2);
436  else
437  // return (dw1 > dw2 ? -1 : 1);
438  return ((int)dw2 - (int)dw1);
439  }
440 
441  case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
442  {
443  qw1 = *(DWORDLONG*)l->val;
444  qw2 = *(DWORDLONG*)r->val;
445  if (pSortInfo->bSortAscending)
446  // return (qw1 > qw2 ? 1 : -1);
447  return ((int)qw1 - (int)qw2);
448  else
449  // return (qw1 > qw2 ? -1 : 1);
450  return ((int)qw2 - (int)qw1);
451  }
452 
453  default:
454  {
455  INT nCompare = 0;
456 
457  if (pSortInfo->bSortAscending)
458  {
459  nCompare = memcmp(l->val, r->val, min(l->val_len, r->val_len));
460  if (nCompare == 0)
461  nCompare = l->val_len - r->val_len;
462  }
463  else
464  {
465  nCompare = memcmp(r->val, l->val, min(r->val_len, l->val_len));
466  if (nCompare == 0)
467  nCompare = r->val_len - l->val_len;
468  }
469 
470  return nCompare;
471  }
472  }
473  }
474 
475  /* Sort by name */
476  return (pSortInfo->bSortAscending ? StrCmpLogicalW(l->name, r->name) : StrCmpLogicalW(r->name, l->name));
477 }
478 
479 static BOOL ListView_Sort(HWND hListView, int iSortingColumn, int iSortedColumn)
480 {
481  if (!(GetWindowLongPtr(hListView, GWL_STYLE) & LVS_NOSORTHEADER) &&
482  (iSortingColumn >= 0) )
483  {
485  SORT_INFO SortInfo;
486 
487  HWND hHeader = ListView_GetHeader(hListView);
488  HDITEM hColumn = {0};
489 
490  /* If we are sorting according to another column, uninitialize the old one */
491  if ( (iSortedColumn >= 0) && (iSortingColumn != iSortedColumn) )
492  {
493  hColumn.mask = HDI_FORMAT;
494  Header_GetItem(hHeader, iSortedColumn, &hColumn);
495  hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
496  Header_SetItem(hHeader, iSortedColumn, &hColumn);
497  }
498 
499  /* Get the sorting state of the new column */
500  hColumn.mask = HDI_FORMAT;
501  Header_GetItem(hHeader, iSortingColumn, &hColumn);
502 
503  /*
504  * Check whether we are sorting the list because the user clicked
505  * on a column, or because we are refreshing the list:
506  *
507  * iSortedColumn >= 0 - User clicked on a column; holds the
508  * old sorting column index.
509  * iSortedColumn < 0 - List being refreshed.
510  */
511  if (iSortedColumn >= 0)
512  {
513  /* Invert the sorting direction */
514  bSortAscending = ((hColumn.fmt & HDF_SORTUP) == 0);
515  }
516  else
517  {
518  /*
519  * If the sorting state of the column is uninitialized,
520  * initialize it by default to ascending sorting.
521  */
522  if ((hColumn.fmt & (HDF_SORTUP | HDF_SORTDOWN)) == 0)
523  hColumn.fmt |= HDF_SORTUP;
524 
525  /* Keep the same sorting direction */
526  bSortAscending = ((hColumn.fmt & HDF_SORTUP) != 0);
527  }
528 
529  /* Set the new column sorting state */
530  hColumn.fmt &= ~(bSortAscending ? HDF_SORTDOWN : HDF_SORTUP );
531  hColumn.fmt |= (bSortAscending ? HDF_SORTUP : HDF_SORTDOWN);
532  Header_SetItem(hHeader, iSortingColumn, &hColumn);
533 
534  /* Sort the list */
535  SortInfo.iSortingColumn = iSortingColumn;
536  SortInfo.bSortAscending = bSortAscending;
537  return ListView_SortItems(hListView, CompareFunc, (LPARAM)&SortInfo);
538  }
539  else
540  return TRUE;
541 }
542 
544 {
546  int iSortingColumn;
548  *Result = TRUE;
549  switch (((LPNMHDR)lParam)->code)
550  {
551  case LVN_GETDISPINFO:
553  return TRUE;
554  case LVN_COLUMNCLICK:
555  iSortingColumn = ((LPNMLISTVIEW)lParam)->iSubItem;
556  (void)ListView_Sort(hWnd, iSortingColumn, g_iSortedColumn);
557  g_iSortedColumn = iSortingColumn;
558  return TRUE;
559  case NM_DBLCLK:
560  case NM_RETURN:
561  {
563  }
564  return TRUE;
565  case NM_SETFOCUS:
567  break;
568  case LVN_BEGINLABELEDIT:
570  if(Info)
571  {
572  PLINE_INFO lineinfo = (PLINE_INFO)Info->item.lParam;
573  if(!lineinfo->name || !wcscmp(lineinfo->name, L""))
574  {
575  *Result = TRUE;
576  }
577  else
578  {
579  *Result = FALSE;
580  }
581  }
582  else
583  *Result = TRUE;
584  return TRUE;
585  case LVN_ENDLABELEDIT:
587  if(Info && Info->item.pszText)
588  {
589  PLINE_INFO lineinfo = (PLINE_INFO)Info->item.lParam;
590  if(!lineinfo->name || !wcscmp(lineinfo->name, L""))
591  {
592  *Result = FALSE;
593  }
594  else
595  {
596  if(wcslen(Info->item.pszText) == 0)
597  {
598  WCHAR msg[128], caption[128];
599 
601  LoadStringW(hInst, IDS_ERR_RENVAL_CAPTION, caption, COUNT_OF(caption));
602  MessageBoxW(0, msg, caption, 0);
603  *Result = TRUE;
604  }
605  else
606  {
607  HKEY hKeyRoot;
608  LPCWSTR keyPath;
609  LONG lResult;
610 
611  keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
612  lResult = RenameValue(hKeyRoot, keyPath, Info->item.pszText, lineinfo->name);
613  lineinfo->name = realloc(lineinfo->name, (wcslen(Info->item.pszText)+1)*sizeof(WCHAR));
614  if (lineinfo->name != NULL)
615  wcscpy(lineinfo->name, Info->item.pszText);
616 
617  *Result = TRUE;
618  return (lResult == ERROR_SUCCESS);
619  }
620  }
621  }
622  else
623  *Result = TRUE;
624 
625  return TRUE;
626  }
627  return FALSE;
628 }
629 
631 {
632  RECT rcClient;
633  HWND hwndLV;
634 
635  /* Get the dimensions of the parent window's client area, and create the list view control. */
636  GetClientRect(hwndParent, &rcClient);
637  hwndLV = CreateWindowExW(WS_EX_CLIENTEDGE, WC_LISTVIEW, L"List View",
639  0, 0, rcClient.right, rcClient.bottom,
640  hwndParent, id, hInst, NULL);
641  if (!hwndLV) return NULL;
642 
643  /* Initialize the image list, and add items to the control. */
644  if (!CreateListColumns(hwndLV, cx)) goto fail;
645  if (!InitListViewImageLists(hwndLV)) goto fail;
646 
647  return hwndLV;
648 fail:
649  DestroyWindow(hwndLV);
650  return NULL;
651 }
652 
653 void DestroyListView(HWND hwndLV)
654 {
655  INT count, i;
656  LVITEMW item;
657 
658  count = ListView_GetItemCount(hwndLV);
659  for (i = 0; i < count; i++)
660  {
661  item.mask = LVIF_PARAM;
662  item.iItem = i;
663  (void)ListView_GetItem(hwndLV, &item);
664  free(((LINE_INFO*)item.lParam)->name);
665  HeapFree(GetProcessHeap(), 0, (void*)item.lParam);
666  }
667 
668 }
669 
670 BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath)
671 {
672  DWORD max_sub_key_len;
673  DWORD max_val_name_len;
674  DWORD max_val_size;
675  DWORD val_count;
676  HKEY hNewKey;
677  LONG errCode;
678  INT i, c;
679  BOOL AddedDefault = FALSE;
680 
681  if (!hwndLV) return FALSE;
682 
683  (void)ListView_EditLabel(hwndLV, -1);
684 
685  SendMessageW(hwndLV, WM_SETREDRAW, FALSE, 0);
686  DestroyListView(hwndLV);
687 
688  (void)ListView_DeleteAllItems(hwndLV);
689 
690  if(!hKey) return FALSE;
691 
692  errCode = RegOpenKeyExW(hKey, keyPath, 0, KEY_READ, &hNewKey);
693  if (errCode != ERROR_SUCCESS) return FALSE;
694 
695  /* get size information and resize the buffers if necessary */
696  errCode = RegQueryInfoKeyW(hNewKey, NULL, NULL, NULL, NULL, &max_sub_key_len, NULL,
697  &val_count, &max_val_name_len, &max_val_size, NULL, NULL);
698 
699  if (errCode == ERROR_SUCCESS)
700  {
701  WCHAR* ValName = HeapAlloc(GetProcessHeap(), 0, ++max_val_name_len * sizeof(WCHAR));
702  DWORD dwValNameLen = max_val_name_len;
703  BYTE* ValBuf = HeapAlloc(GetProcessHeap(), 0, max_val_size + sizeof(WCHAR));
704  DWORD dwValSize = max_val_size;
705  DWORD dwIndex = 0L;
706  DWORD dwValType;
707  /* if (RegQueryValueExW(hNewKey, NULL, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS) { */
708  /* AddEntryToList(hwndLV, L"(Default)", dwValType, ValBuf, dwValSize); */
709  /* } */
710  /* dwValSize = max_val_size; */
711  while (RegEnumValueW(hNewKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS)
712  {
713  /* Add a terminating 0 character. Usually this is only necessary for strings. */
714  ValBuf[dwValSize] = ValBuf[dwValSize + 1] = 0;
715 
716  AddEntryToList(hwndLV, ValName, dwValType, ValBuf, dwValSize, -1, TRUE);
717  dwValNameLen = max_val_name_len;
718  dwValSize = max_val_size;
719  dwValType = 0L;
720  ++dwIndex;
721  if(!wcscmp(ValName, L""))
722  {
723  AddedDefault = TRUE;
724  }
725  }
726  HeapFree(GetProcessHeap(), 0, ValBuf);
727  HeapFree(GetProcessHeap(), 0, ValName);
728  }
729  RegCloseKey(hNewKey);
730 
731  if(!AddedDefault)
732  {
733  AddEntryToList(hwndLV, L"", REG_SZ, NULL, 0, 0, FALSE);
734  }
735  c = ListView_GetItemCount(hwndLV);
736  for(i = 0; i < c; i++)
737  {
739  }
743  (void)ListView_Sort(hwndLV, g_iSortedColumn, -1);
744  SendMessageW(hwndLV, WM_SETREDRAW, TRUE, 0);
745 
746  return TRUE;
747 }
#define realloc
Definition: debug_ros.c:6
INT WINAPI ImageList_GetImageCount(HIMAGELIST himl)
Definition: imagelist.c:2063
VOID SetValueName(HWND hwndLV, LPCWSTR pszValueName)
Definition: listview.c:84
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2406
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define LVN_BEGINLABELEDIT
Definition: commctrl.h:3130
#define MAKEWPARAM(l, h)
Definition: winuser.h:3948
#define IDS_DEFAULT_VALUE_NAME
Definition: resource.h:128
#define CY_ICON
Definition: listview.c:24
void DestroyListView(HWND hwndLV)
Definition: listview.c:653
ChildWnd * g_pChildWnd
Definition: childwnd.c:23
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define LVCF_WIDTH
Definition: commctrl.h:2559
BOOL bSortAscending
Definition: listview.c:42
#define LVSIL_SMALL
Definition: commctrl.h:2271
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LVCF_TEXT
Definition: commctrl.h:2560
struct tagLINE_INFO LINE_INFO
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2239
INT iListViewSelect
Definition: listview.c:29
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int Image_Bin
Definition: listview.c:28
#define LVS_REPORT
Definition: commctrl.h:2234
#define ListView_GetHeader(hwnd)
Definition: commctrl.h:2623
GLuint GLuint GLsizei count
Definition: gl.h:1545
static BOOL CreateListColumns(HWND hWndListView, INT cxTotal)
Definition: listview.c:258
static COORD Position
Definition: mouse.c:34
#define free
Definition: debug_ros.c:5
HWND hTreeWnd
Definition: main.h:60
LONG RenameValue(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpDestValue, LPCWSTR lpSrcValue)
Definition: edit.c:1522
#define CALLBACK
Definition: compat.h:27
#define WM_SETREDRAW
Definition: winuser.h:1598
HWND hWnd
Definition: settings.c:17
#define MAX_LIST_COLUMNS
Definition: listview.c:51
#define LVCFMT_LEFT
Definition: commctrl.h:2570
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: listview.c:380
GLuint buffer
Definition: glext.h:5915
static void OnGetDispInfo(NMLVDISPINFO *plvdi)
Definition: listview.c:312
#define HDF_SORTUP
Definition: commctrl.h:709
#define LVNI_SELECTED
Definition: commctrl.h:2396
UINT_PTR WPARAM
Definition: windef.h:207
static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void *ValBuf, DWORD dwCount, int Position, BOOL ValExists)
Definition: listview.c:125
#define WS_CHILD
Definition: pedump.c:617
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2380
#define IDS_LIST_COLUMN_FIRST
Definition: resource.h:29
LONG right
Definition: windef.h:293
#define HDITEM
Definition: commctrl.h:682
HIMAGELIST himl
BOOL WINAPI DestroyWindow(_In_ HWND)
#define IDS_INVALID_DWORD
Definition: resource.h:134
#define IDI_BIN
Definition: resource.h:46
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:56
#define REG_RESOURCE_REQUIREMENTS_LIST
Definition: nt_native.h:1504
WPARAM wParam
Definition: combotst.c:138
struct TraceInfo Info
#define CX_ICON
Definition: listview.c:23
struct tagLINE_INFO * PLINE_INFO
#define LVIF_TEXT
Definition: commctrl.h:2281
#define LVCF_SUBITEM
Definition: commctrl.h:2561
struct tagSORT_INFO SORT_INFO
#define IDS_UNKNOWN_TYPE
Definition: resource.h:130
#define LVCOLUMN
Definition: commctrl.h:2553
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
size_t val_len
Definition: listview.c:36
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2608
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
unsigned char * LPBYTE
Definition: typedefs.h:52
static const WCHAR szText[]
Definition: dialog.c:139
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2645
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
int iSubItem
Definition: commctrl.h:2334
#define REG_MULTI_SZ
Definition: nt_native.h:1501
BOOL IsDefaultValue(HWND hwndLV, int i)
Definition: listview.c:107
#define HDI_FORMAT
Definition: commctrl.h:690
LPARAM lParam
Definition: commctrl.h:2340
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:736
static int iSortedColumn
Definition: srvpage.cpp:27
struct NameRec_ * Name
Definition: cdprocs.h:464
LPCWSTR GetValueName(HWND hwndLV, int iStartAt)
Definition: listview.c:55
const WCHAR * str
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:2853
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2276
smooth NULL
Definition: ftsmooth.c:416
#define LVIS_SELECTED
Definition: commctrl.h:2291
static HWND hwndParent
Definition: cryptui.c:300
_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:426
LONG_PTR LPARAM
Definition: windef.h:208
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2279
#define REG_RESOURCE_LIST
Definition: nt_native.h:1502
GLuint index
Definition: glext.h:6031
LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY *phRootKey)
Definition: treeview.c:83
static BOOL bSortAscending
Definition: applpage.c:41
#define REG_FULL_RESOURCE_DESCRIPTOR
Definition: nt_native.h:1503
r l[0]
Definition: byte_order.h:167
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2663
BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
Definition: listview.c:543
#define NMLVDISPINFO
Definition: commctrl.h:3154
#define COUNT_OF(a)
Definition: main.h:33
#define REG_LINK
Definition: nt_native.h:1500
DWORD dwValType
Definition: listview.c:33
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IDI_STRING
Definition: resource.h:45
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NM_SETFOCUS
Definition: commctrl.h:135
static int
Definition: listview.c:31
#define LVIF_IMAGE
Definition: commctrl.h:2282
LPCWSTR psz
Definition: commctrl.h:2429
const GLubyte * c
Definition: glext.h:8905
#define HDF_SORTDOWN
Definition: commctrl.h:710
unsigned long DWORD
Definition: ntddk_ex.h:95
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
HICON hico
#define IDS_ERR_RENVAL_TOEMPTY
Definition: resource.h:141
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:3686
UINT mask
Definition: commctrl.h:2332
INT WINAPI StrCmpLogicalW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:2296
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define index(s, c)
Definition: various.h:29
#define IDS_ERR_RENVAL_CAPTION
Definition: resource.h:140
static const WCHAR L[]
Definition: oid.c:1250
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)
BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath)
Definition: listview.c:670
#define ILC_MASK
Definition: commctrl.h:336
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#define WS_TABSTOP
Definition: pedump.c:634
GLenum src
Definition: glext.h:6340
#define WM_COMMAND
Definition: winuser.h:1722
INT iSortingColumn
Definition: listview.c:41
LPWSTR name
Definition: listview.c:34
static const int default_column_widths[MAX_LIST_COLUMNS]
Definition: listview.c:52
int Image_String
Definition: listview.c:27
#define LVN_GETDISPINFO
Definition: commctrl.h:3132
#define REG_DWORD_BIG_ENDIAN
Definition: nt_native.h:1499
#define GWL_STYLE
Definition: winuser.h:846
static INT g_iSortedColumn
Definition: listview.c:49
#define ID_EDIT_MODIFY
Definition: resource.h:64
#define NM_RETURN
Definition: commctrl.h:132
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND hFrameWnd
Definition: main.c:30
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define LVCF_FMT
Definition: commctrl.h:2558
HINSTANCE hInst
Definition: dxdiag.c:13
static BOOL ListView_Sort(HWND hListView, int iSortingColumn, int iSortedColumn)
Definition: listview.c:479
static ATOM item
Definition: dde.c:856
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
static BOOL InitListViewImageLists(HWND hwndLV)
Definition: listview.c:280
#define NM_DBLCLK
Definition: commctrl.h:131
#define LVS_EDITLABELS
Definition: commctrl.h:2245
struct tagNMLISTVIEW * LPNMLISTVIEW
#define IDS_BINARY_EMPTY
Definition: resource.h:127
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static const int column_alignment[MAX_LIST_COLUMNS]
Definition: listview.c:53
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define min(a, b)
Definition: monoChain.cc:55
BOOL CreateListView(PMAIN_WND_INFO Info)
Definition: listview.c:355
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
void * val
Definition: listview.c:35
#define LVN_COLUMNCLICK
Definition: commctrl.h:3111
struct tagSORT_INFO * PSORT_INFO
#define WC_LISTVIEW
Definition: commctrl.h:2231
#define msg(x)
Definition: auth_time.c:54
unsigned long long DWORDLONG
Definition: intsafe.h:99
_Out_opt_ int * cx
Definition: commctrl.h:570
#define LVFI_STRING
Definition: commctrl.h:2409
#define ListView_FindItem(hwnd, iStart, plvfi)
Definition: commctrl.h:2442
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2366
#define ListView_SortItems(hwndLV, _pfnCompare, _lPrm)
Definition: commctrl.h:2675
#define LVIF_PARAM
Definition: commctrl.h:2283
#define c
Definition: ke_i.h:80
#define REG_QWORD
Definition: sdbapi.c:597
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
LONG bottom
Definition: windef.h:294
#define LVS_NOSORTHEADER
Definition: commctrl.h:2257
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define GetWindowLongPtr
Definition: treelist.c:73
#define REG_NONE
Definition: nt_native.h:1492
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:743
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LPSTR_TEXTCALLBACK
Definition: commctrl.h:2355
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
#define wsprintf
Definition: winuser.h:5766
#define LISTVIEW_NUM_ICONS
Definition: listview.c:25
#define IDS_VALUE_NOT_SET
Definition: resource.h:129
#define WS_VISIBLE
Definition: pedump.c:620
#define LVN_ENDLABELEDIT
Definition: commctrl.h:3131
#define REG_DWORD
Definition: sdbapi.c:596
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPARAM lParam
Definition: combotst.c:139
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
#define LVIS_FOCUSED
Definition: commctrl.h:2290
#define ListView_EditLabel(hwndLV, i)
Definition: commctrl.h:2512
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2386
int nFocusPanel
Definition: main.h:64
#define REG_SZ
Definition: layer.c:22