ReactOS 0.4.15-dev-7924-g5949c20
treeview.c File Reference
#include "regedit.h"
Include dependency graph for treeview.c:

Go to the source code of this file.

Macros

#define NUM_ICONS   3
 
#define IDI_SHELL_FOLDER   4
 
#define IDI_SHELL_FOLDER_OPEN   5
 
#define IDI_SHELL_MY_COMPUTER   16
 

Functions

static BOOL get_item_path (HWND hwndTV, HTREEITEM hItem, HKEY *phKey, LPWSTR *pKeyPath, int *pPathLen, int *pMaxLen)
 
LPCWSTR GetItemPath (HWND hwndTV, HTREEITEM hItem, HKEY *phRootKey)
 
BOOL DeleteNode (HWND hwndTV, HTREEITEM hItem)
 
static HTREEITEM AddEntryToTree (HWND hwndTV, HTREEITEM hParent, LPWSTR label, HKEY hKey, DWORD dwChildren)
 
BOOL RefreshTreeItem (HWND hwndTV, HTREEITEM hItem)
 
BOOL RefreshTreeView (HWND hwndTV)
 
HTREEITEM InsertNode (HWND hwndTV, HTREEITEM hItem, LPWSTR name)
 
HWND StartKeyRename (HWND hwndTV)
 
static BOOL InitTreeViewItems (HWND hwndTV, LPWSTR pHostName)
 
static BOOL InitTreeViewImageLists (HWND hwndTV)
 
BOOL OnTreeExpanding (HWND hwndTV, NMTREEVIEW *pnmtv)
 
BOOL CreateNewKey (HWND hwndTV, HTREEITEM hItem)
 
BOOL TreeWndNotifyProc (HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
 
HWND CreateTreeView (HWND hwndParent, LPWSTR pHostName, HMENU id)
 
void DestroyTreeView (HWND hwndTV)
 
BOOL SelectNode (HWND hwndTV, LPCWSTR keyPath)
 

Variables

static int Image_Open = 0
 
static int Image_Closed = 0
 
static int Image_Root = 0
 
static LPWSTR pathBuffer
 

Macro Definition Documentation

◆ IDI_SHELL_FOLDER

#define IDI_SHELL_FOLDER   4

Definition at line 36 of file treeview.c.

◆ IDI_SHELL_FOLDER_OPEN

#define IDI_SHELL_FOLDER_OPEN   5

Definition at line 37 of file treeview.c.

◆ IDI_SHELL_MY_COMPUTER

#define IDI_SHELL_MY_COMPUTER   16

Definition at line 38 of file treeview.c.

◆ NUM_ICONS

#define NUM_ICONS   3

Definition at line 33 of file treeview.c.

Function Documentation

◆ AddEntryToTree()

static HTREEITEM AddEntryToTree ( HWND  hwndTV,
HTREEITEM  hParent,
LPWSTR  label,
HKEY  hKey,
DWORD  dwChildren 
)
static

Definition at line 126 of file treeview.c.

127{
128 TVITEMW tvi;
129 TVINSERTSTRUCTW tvins;
130
131 if (hKey)
132 {
133 if (RegQueryInfoKeyW(hKey, 0, 0, 0, &dwChildren, 0, 0, 0, 0, 0, 0, 0) != ERROR_SUCCESS)
134 {
135 dwChildren = 0;
136 }
137 }
138
140 tvi.pszText = label;
141 tvi.cchTextMax = wcslen(tvi.pszText);
142 tvi.iImage = Image_Closed;
144 tvi.cChildren = dwChildren;
145 tvi.lParam = (LPARAM)hKey;
146 tvins.item = tvi;
148 tvins.hParent = hParent;
149 return TreeView_InsertItem(hwndTV, &tvins);
150}
static int Image_Open
Definition: treeview.c:27
static int Image_Closed
Definition: treeview.c:28
#define ERROR_SUCCESS
Definition: deptool.c:10
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:3662
FxAutoRegKey hKey
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static const WCHAR label[]
Definition: itemdlg.c:1546
#define TVI_LAST
Definition: commctrl.h:3370
#define TVIF_TEXT
Definition: commctrl.h:3266
#define TVIF_IMAGE
Definition: commctrl.h:3267
#define TVI_FIRST
Definition: commctrl.h:3369
struct _TREEITEM * HTREEITEM
Definition: commctrl.h:3264
#define TVIF_PARAM
Definition: commctrl.h:3268
#define TVIF_CHILDREN
Definition: commctrl.h:3272
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3412
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3271
HTREEITEM hParent
Definition: commctrl.h:3393
HTREEITEM hInsertAfter
Definition: commctrl.h:3394
LPARAM lParam
Definition: commctrl.h:3325
UINT mask
Definition: commctrl.h:3316
LPWSTR pszText
Definition: commctrl.h:3320
int cchTextMax
Definition: commctrl.h:3321
int iImage
Definition: commctrl.h:3322
int cChildren
Definition: commctrl.h:3324
int iSelectedImage
Definition: commctrl.h:3323
LONG_PTR LPARAM
Definition: windef.h:208

Referenced by InitTreeViewItems(), InsertNode(), OnTreeExpanding(), and RefreshTreeItem().

◆ CreateNewKey()

BOOL CreateNewKey ( HWND  hwndTV,
HTREEITEM  hItem 
)

Definition at line 584 of file treeview.c.

585{
586 WCHAR szNewKeyFormat[128];
587 WCHAR szNewKey[128];
588 LPCWSTR pszKeyPath;
589 int iIndex = 1;
590 LONG nResult;
591 HKEY hRootKey = NULL, hKey = NULL, hNewKey = NULL;
593 DWORD dwDisposition;
594 HTREEITEM hNewItem;
595
596 pszKeyPath = GetItemPath(hwndTV, hItem, &hRootKey);
597 if (pszKeyPath[0] == L'\0')
598 hKey = hRootKey;
599 else if (RegOpenKeyW(hRootKey, pszKeyPath, &hKey) != ERROR_SUCCESS)
600 goto done;
601
602 if (LoadStringW(hInst, IDS_NEW_KEY, szNewKeyFormat, ARRAY_SIZE(szNewKeyFormat)) <= 0)
603 goto done;
604
605 /* Need to create a new key with a unique name */
606 do
607 {
608 wsprintf(szNewKey, szNewKeyFormat, iIndex++);
609 nResult = RegCreateKeyExW(hKey, szNewKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hNewKey, &dwDisposition);
610 if (hNewKey && dwDisposition == REG_OPENED_EXISTING_KEY)
611 {
612 RegCloseKey(hNewKey);
613 hNewKey = NULL;
614 }
615 else if (!hNewKey)
616 {
617 InfoMessageBox(hFrameWnd, MB_OK | MB_ICONERROR, NULL, L"Cannot create new key!\n\nError Code: %d", nResult);
618 goto done;
619 }
620 }
621 while(!hNewKey);
622
623 /* Insert the new key */
624 hNewItem = InsertNode(hwndTV, hItem, szNewKey);
625 if (!hNewItem)
626 goto done;
627
628 /* The new key's name is probably not appropriate yet */
629 (void)TreeView_EditLabel(hwndTV, hNewItem);
630
631 bSuccess = TRUE;
632
633done:
634 if (hKey != hRootKey && hKey)
636 if (hNewKey)
637 RegCloseKey(hNewKey);
638 return bSuccess;
639}
int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMessage,...)
Definition: error.c:51
HWND hFrameWnd
Definition: main.c:35
#define ARRAY_SIZE(A)
Definition: main.h:33
#define IDS_NEW_KEY
Definition: resource.h:192
LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY *phRootKey)
Definition: treeview.c:88
HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name)
Definition: treeview.c:347
#define RegCloseKey(hKey)
Definition: registry.h:49
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
static BOOLEAN bSuccess
Definition: drive.cpp:433
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
#define REG_OPENED_EXISTING_KEY
Definition: nt_native.h:1085
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define TreeView_EditLabel(hwnd, hitem)
Definition: commctrl.h:3504
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MB_ICONERROR
Definition: winuser.h:787
#define MB_OK
Definition: winuser.h:790
#define wsprintf
Definition: winuser.h:5865
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by _CmdWndProc().

◆ CreateTreeView()

HWND CreateTreeView ( HWND  hwndParent,
LPWSTR  pHostName,
HMENU  id 
)

Definition at line 752 of file treeview.c.

753{
754 RECT rcClient;
755 HWND hwndTV;
756
757 /* Get the dimensions of the parent window's client area, and create the tree view control. */
758 GetClientRect(hwndParent, &rcClient);
761 0, 0, rcClient.right, rcClient.bottom,
762 hwndParent, id, hInst, NULL);
763 if (!hwndTV) return NULL;
764
765 /* Initialize the image list, and add items to the control. */
766 if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, pHostName))
767 {
768 DestroyWindow(hwndTV);
769 return NULL;
770 }
771 return hwndTV;
772}
static BOOL InitTreeViewImageLists(HWND hwndTV)
Definition: treeview.c:454
static BOOL InitTreeViewItems(HWND hwndTV, LPWSTR pHostName)
Definition: treeview.c:407
static HWND hwndParent
Definition: cryptui.c:300
#define WS_CHILD
Definition: pedump.c:617
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_VISIBLE
Definition: pedump.c:620
#define TVS_LINESATROOT
Definition: commctrl.h:3249
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3252
#define TVS_HASLINES
Definition: commctrl.h:3248
#define WC_TREEVIEW
Definition: commctrl.h:3245
#define TVS_HASBUTTONS
Definition: commctrl.h:3247
#define TVS_EDITLABELS
Definition: commctrl.h:3250
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
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 WS_EX_CLIENTEDGE
Definition: winuser.h:384
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by ChildWndProc().

◆ DeleteNode()

BOOL DeleteNode ( HWND  hwndTV,
HTREEITEM  hItem 
)

Definition at line 118 of file treeview.c.

119{
120 if (!hItem) hItem = TreeView_GetSelection(hwndTV);
121 if (!hItem) return FALSE;
122 return TreeView_DeleteItem(hwndTV, hItem);
123}
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3473
#define TreeView_DeleteItem(hwnd, hitem)
Definition: commctrl.h:3415

◆ DestroyTreeView()

void DestroyTreeView ( HWND  hwndTV)

Definition at line 774 of file treeview.c.

775{
777
779
780 /* Destroy the image list associated with the tree view control */
783}
static LPWSTR pathBuffer
Definition: treeview.c:31
HIMAGELIST himl
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
#define TVSIL_NORMAL
Definition: commctrl.h:3443
#define TreeView_GetImageList(hwnd, iImage)
Definition: commctrl.h:3441

◆ get_item_path()

static BOOL get_item_path ( HWND  hwndTV,
HTREEITEM  hItem,
HKEY phKey,
LPWSTR pKeyPath,
int pPathLen,
int pMaxLen 
)
static

Definition at line 40 of file treeview.c.

41{
43 size_t maxLen, len;
44 LPWSTR newStr;
45
46 item.mask = TVIF_PARAM;
47 item.hItem = hItem;
48 if (!TreeView_GetItem(hwndTV, &item)) return FALSE;
49
50 if (item.lParam)
51 {
52 /* found root key with valid key value */
53 *phKey = (HKEY)item.lParam;
54 return TRUE;
55 }
56
57 if(!get_item_path(hwndTV, TreeView_GetParent(hwndTV, hItem), phKey, pKeyPath, pPathLen, pMaxLen)) return FALSE;
58 if (*pPathLen)
59 {
60 (*pKeyPath)[*pPathLen] = L'\\';
61 ++(*pPathLen);
62 }
63
64 do
65 {
66 item.mask = TVIF_TEXT;
67 item.hItem = hItem;
68 item.pszText = *pKeyPath + *pPathLen;
69 maxLen = *pMaxLen - *pPathLen;
70 item.cchTextMax = (int) maxLen;
71 if (!TreeView_GetItem(hwndTV, &item)) return FALSE;
72 len = wcslen(item.pszText);
73 if (len < maxLen - 1)
74 {
75 *pPathLen += (int) len;
76 break;
77 }
78 newStr = HeapReAlloc(GetProcessHeap(), 0, *pKeyPath, *pMaxLen * 2);
79 if (!newStr) return FALSE;
80 *pKeyPath = newStr;
81 *pMaxLen *= 2;
82 }
83 while(TRUE);
84
85 return TRUE;
86}
static BOOL get_item_path(HWND hwndTV, HTREEITEM hItem, HKEY *phKey, LPWSTR *pKeyPath, int *pPathLen, int *pMaxLen)
Definition: treeview.c:40
HANDLE HKEY
Definition: registry.h:26
#define HeapReAlloc
Definition: compat.h:734
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
GLenum GLsizei len
Definition: glext.h:6722
static ATOM item
Definition: dde.c:856
#define TreeView_GetParent(hwnd, hitem)
Definition: commctrl.h:3469
#define TreeView_GetItem(hwnd, pitem)
Definition: commctrl.h:3490
HTREEITEM hItem
Definition: treelist.h:37
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by get_item_path(), and GetItemPath().

◆ GetItemPath()

LPCWSTR GetItemPath ( HWND  hwndTV,
HTREEITEM  hItem,
HKEY phRootKey 
)

Definition at line 88 of file treeview.c.

89{
90 int pathLen = 0, maxLen;
91
92 *phRootKey = NULL;
93
94 if (!pathBuffer)
95 {
97 }
98 if (!pathBuffer)
99 {
100 return NULL;
101 }
102
104
105 maxLen = (int) HeapSize(GetProcessHeap(), 0, pathBuffer);
106
107 if (!hItem)
108 {
110 }
111 if (maxLen == -1 || !hItem || !get_item_path(hwndTV, hItem, phRootKey, &pathBuffer, &pathLen, &maxLen))
112 {
113 return NULL;
114 }
115 return pathBuffer;
116}
#define HeapAlloc
Definition: compat.h:733
#define UNICODE_NULL
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)

Referenced by _CmdWndProc(), ChildWndProc(), CreateNewKey(), ExportRegistryFile(), FindNext(), ImportRegistryFile(), ListWndNotifyProc(), LoadHive(), OnTreeExpanding(), RefreshTreeItem(), SaveSettings(), TreeWndNotifyProc(), UnloadHive(), UpdateAddress(), and UpdateStatusBar().

◆ InitTreeViewImageLists()

static BOOL InitTreeViewImageLists ( HWND  hwndTV)
static

Definition at line 454 of file treeview.c.

455{
456 HIMAGELIST himl; /* handle to image list */
457 HICON hico; /* handle to icon */
460 HMODULE hShell32 = GetModuleHandleW(L"shell32.dll");
461
462 /* Create the image list. */
464 return FALSE;
465
466 /* Add the open file, closed file, and document bitmaps. */
470 cx,
471 cy,
473 if (hico)
474 {
477 }
478
482 cx,
483 cy,
485 if (hico)
486 {
489 }
490
494 cx,
495 cy,
497 if (hico)
498 {
501 }
502
503 /* Fail if not all of the images were added. */
505 {
507 return FALSE;
508 }
509
510 /* Associate the image list with the tree view control. */
512
513 return TRUE;
514}
#define IDI_SHELL_FOLDER
Definition: treeview.c:36
#define NUM_ICONS
Definition: treeview.c:33
static int Image_Root
Definition: treeview.c:29
#define IDI_SHELL_MY_COMPUTER
Definition: treeview.c:38
#define IDI_SHELL_FOLDER_OPEN
Definition: treeview.c:37
HICON hico
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
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
static HICON
Definition: imagelist.c:84
static HMODULE hShell32
Definition: string.c:34
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define ILC_COLOR32
Definition: commctrl.h:358
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define ILC_MASK
Definition: commctrl.h:351
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3447
int32_t INT
Definition: typedefs.h:58
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2203
#define SM_CYSMICON
Definition: winuser.h:1013
#define SM_CXSMICON
Definition: winuser.h:1012
#define LR_DEFAULTCOLOR
Definition: winuser.h:1087
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2053

Referenced by CreateTreeView().

◆ InitTreeViewItems()

static BOOL InitTreeViewItems ( HWND  hwndTV,
LPWSTR  pHostName 
)
static

Definition at line 407 of file treeview.c.

408{
409 TVITEMW tvi;
410 TVINSERTSTRUCTW tvins;
412
414 /* Set the text of the item. */
415 tvi.pszText = pHostName;
416 tvi.cchTextMax = wcslen(tvi.pszText);
417 /* Assume the item is not a parent item, so give it an image. */
418 tvi.iImage = Image_Root;
420 tvi.cChildren = 5;
421 /* Save the heading level in the item's application-defined data area. */
422 tvi.lParam = (LPARAM)NULL;
423 tvins.item = tvi;
425 tvins.hParent = TVI_ROOT;
426 /* Add the item to the tree view control. */
427 if (!(hRoot = TreeView_InsertItem(hwndTV, &tvins))) return FALSE;
428
429 if (!AddEntryToTree(hwndTV, hRoot, L"HKEY_CLASSES_ROOT", HKEY_CLASSES_ROOT, 1)) return FALSE;
430 if (!AddEntryToTree(hwndTV, hRoot, L"HKEY_CURRENT_USER", HKEY_CURRENT_USER, 1)) return FALSE;
431 if (!AddEntryToTree(hwndTV, hRoot, L"HKEY_LOCAL_MACHINE", HKEY_LOCAL_MACHINE, 1)) return FALSE;
432 if (!AddEntryToTree(hwndTV, hRoot, L"HKEY_USERS", HKEY_USERS, 1)) return FALSE;
433 if (!AddEntryToTree(hwndTV, hRoot, L"HKEY_CURRENT_CONFIG", HKEY_CURRENT_CONFIG, 1)) return FALSE;
434
435 if (GetVersion() & 0x80000000)
436 {
437 /* Win9x specific key */
438 if (!AddEntryToTree(hwndTV, hRoot, L"HKEY_DYN_DATA", HKEY_DYN_DATA, 1)) return FALSE;
439 }
440
441 /* expand and select host name */
444 return TRUE;
445}
static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPWSTR label, HKEY hKey, DWORD dwChildren)
Definition: treeview.c:126
static HTREEITEM hRoot
Definition: treeview.c:381
#define TreeView_Select(hwnd, hitem, code)
Definition: commctrl.h:3479
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3420
#define TVE_EXPAND
Definition: commctrl.h:3423
#define TVI_ROOT
Definition: commctrl.h:3368
#define TVGN_CARET
Definition: commctrl.h:3461
DWORD WINAPI GetVersion()
Definition: redirtest.c:5
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15
#define HKEY_DYN_DATA
Definition: winreg.h:16
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define HKEY_USERS
Definition: winreg.h:13

Referenced by CreateTreeView().

◆ InsertNode()

HTREEITEM InsertNode ( HWND  hwndTV,
HTREEITEM  hItem,
LPWSTR  name 
)

Definition at line 347 of file treeview.c.

348{
350 HTREEITEM hNewItem = 0;
352
353 /* Default to the current selection */
354 if (!hItem)
355 {
357 if (!hItem)
358 return FALSE;
359 }
360
361 memset(&item, 0, sizeof(item));
362 item.hItem = hItem;
364 if (!TreeView_GetItem(hwndTV, &item))
365 return FALSE;
366
367 if (item.state & TVIS_EXPANDEDONCE)
368 {
369 hNewItem = AddEntryToTree(hwndTV, hItem, name, 0, 0);
371 }
372 else
373 {
375 item.hItem = hItem;
376 item.cChildren = 1;
377 if (!TreeView_SetItem(hwndTV, &item))
378 return FALSE;
379 }
380
382 if (!hNewItem)
383 {
384 for(hNewItem = TreeView_GetChild(hwndTV, hItem); hNewItem; hNewItem = TreeView_GetNextSibling(hwndTV, hNewItem))
385 {
386 item.mask = TVIF_HANDLE | TVIF_TEXT;
387 item.hItem = hNewItem;
388 item.pszText = buf;
389 item.cchTextMax = ARRAY_SIZE(buf);
390 if (!TreeView_GetItem(hwndTV, &item)) continue;
391 if (wcscmp(name, item.pszText) == 0) break;
392 }
393 }
394 if (hNewItem) (void)TreeView_SelectItem(hwndTV, hNewItem);
395
396 return hNewItem;
397}
#define MAX_NEW_KEY_LEN
Definition: main.h:41
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define TreeView_SelectItem(hwnd, hitem)
Definition: commctrl.h:3481
#define TreeView_GetChild(hwnd, hitem)
Definition: commctrl.h:3466
#define TVIS_EXPANDEDONCE
Definition: commctrl.h:3285
#define TVM_SORTCHILDREN
Definition: commctrl.h:3541
#define TVIF_HANDLE
Definition: commctrl.h:3270
#define TreeView_GetNextSibling(hwnd, hitem)
Definition: commctrl.h:3467
#define TreeView_SetItem(hwnd, pitem)
Definition: commctrl.h:3497
#define TVIF_STATE
Definition: commctrl.h:3269
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define memset(x, y, z)
Definition: compat.h:39
Definition: name.c:39
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CreateNewKey().

◆ OnTreeExpanding()

BOOL OnTreeExpanding ( HWND  hwndTV,
NMTREEVIEW pnmtv 
)

Definition at line 516 of file treeview.c.

517{
518 DWORD dwCount, dwIndex, dwMaxSubKeyLen;
519 HKEY hRoot, hNewKey, hKey;
520 LPCWSTR keyPath;
521 LPWSTR Name;
522 LONG errCode;
523 HCURSOR hcursorOld;
524
525 static int expanding;
526 if (expanding) return FALSE;
527 if (pnmtv->itemNew.state & TVIS_EXPANDEDONCE )
528 {
529 return TRUE;
530 }
531 expanding = TRUE;
532 hcursorOld = SetCursor(LoadCursor(NULL, IDC_WAIT));
533 SendMessageW(hwndTV, WM_SETREDRAW, FALSE, 0);
534
535 keyPath = GetItemPath(hwndTV, pnmtv->itemNew.hItem, &hRoot);
536 if (!keyPath) goto done;
537
538 if (*keyPath)
539 {
540 errCode = RegOpenKeyExW(hRoot, keyPath, 0, KEY_READ, &hNewKey);
541 if (errCode != ERROR_SUCCESS) goto done;
542 }
543 else
544 {
545 hNewKey = hRoot;
546 }
547
548 errCode = RegQueryInfoKeyW(hNewKey, 0, 0, 0, &dwCount, &dwMaxSubKeyLen, 0, 0, 0, 0, 0, 0);
549 if (errCode != ERROR_SUCCESS) goto done;
550 dwMaxSubKeyLen++; /* account for the \0 terminator */
551 Name = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen * sizeof(WCHAR));
552 if (!Name) goto done;
553
554 for (dwIndex = 0; dwIndex < dwCount; dwIndex++)
555 {
556 DWORD cName = dwMaxSubKeyLen, dwSubCount;
557
558 errCode = RegEnumKeyExW(hNewKey, dwIndex, Name, &cName, 0, 0, 0, 0);
559 if (errCode != ERROR_SUCCESS) continue;
560 errCode = RegOpenKeyExW(hNewKey, Name, 0, KEY_QUERY_VALUE, &hKey);
561 if (errCode == ERROR_SUCCESS)
562 {
563 errCode = RegQueryInfoKeyW(hKey, 0, 0, 0, &dwSubCount, 0, 0, 0, 0, 0, 0, 0);
565 }
566 if (errCode != ERROR_SUCCESS) dwSubCount = 0;
567 AddEntryToTree(hwndTV, pnmtv->itemNew.hItem, Name, NULL, dwSubCount);
568 }
569
570 SendMessageW(hwndTV, TVM_SORTCHILDREN, 0, (LPARAM)pnmtv->itemNew.hItem);
571
572 RegCloseKey(hNewKey);
574
575done:
576 SendMessageW(hwndTV, WM_SETREDRAW, TRUE, 0);
577 SetCursor(hcursorOld);
578 expanding = FALSE;
579
580 return TRUE;
581}
struct NameRec_ * Name
Definition: cdprocs.h:460
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
HICON HCURSOR
Definition: windef.h:299
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define LoadCursor
Definition: winuser.h:5812
#define IDC_WAIT
Definition: winuser.h:689
#define WM_SETREDRAW
Definition: winuser.h:1616

Referenced by TreeWndNotifyProc().

◆ RefreshTreeItem()

BOOL RefreshTreeItem ( HWND  hwndTV,
HTREEITEM  hItem 
)

Definition at line 152 of file treeview.c.

153{
154 HKEY hRoot, hKey, hSubKey;
155 HTREEITEM childItem;
156 LPCWSTR KeyPath;
157 DWORD dwCount, dwIndex, dwMaxSubKeyLen;
158 LPWSTR Name = NULL;
159 TVITEMW tvItem;
160 LPWSTR pszNodes = NULL;
162 LPWSTR s;
163 BOOL bAddedAny;
164
165 KeyPath = GetItemPath(hwndTV, hItem, &hRoot);
166
167 if (*KeyPath)
168 {
169 if (RegOpenKeyExW(hRoot, KeyPath, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
170 {
171 goto done;
172 }
173 }
174 else
175 {
176 hKey = hRoot;
177 }
178
179 if (RegQueryInfoKeyW(hKey, 0, 0, 0, &dwCount, &dwMaxSubKeyLen, 0, 0, 0, 0, 0, 0) != ERROR_SUCCESS)
180 {
181 goto done;
182 }
183
184 /* Set the number of children again */
185 tvItem.mask = TVIF_CHILDREN;
186 tvItem.hItem = hItem;
187 tvItem.cChildren = dwCount;
188 if (!TreeView_SetItem(hwndTV, &tvItem))
189 {
190 goto done;
191 }
192
193 /* We don't have to bother with the rest if it's not expanded. */
194 if (TreeView_GetItemState(hwndTV, hItem, TVIS_EXPANDED) == 0)
195 {
197 bSuccess = TRUE;
198 goto done;
199 }
200
201 dwMaxSubKeyLen++; /* account for the \0 terminator */
202 if (!(Name = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen * sizeof(WCHAR))))
203 {
204 goto done;
205 }
206 tvItem.cchTextMax = dwMaxSubKeyLen;
207 /*if (!(tvItem.pszText = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen * sizeof(WCHAR)))) {
208 goto done;
209 }*/
210
211 /* Get all of the tree node siblings in one contiguous block of memory */
212 {
213 DWORD dwPhysicalSize = 0;
214 DWORD dwActualSize = 0;
215 DWORD dwNewPhysicalSize;
216 LPWSTR pszNewNodes;
217 DWORD dwStep = 10000;
218
219 for (childItem = TreeView_GetChild(hwndTV, hItem); childItem;
220 childItem = TreeView_GetNextSibling(hwndTV, childItem))
221 {
222
223 if (dwActualSize + dwMaxSubKeyLen + 1 > dwPhysicalSize)
224 {
225 dwNewPhysicalSize = dwActualSize + dwMaxSubKeyLen + 1 + dwStep;
226
227 if (pszNodes)
228 pszNewNodes = (LPWSTR) HeapReAlloc(GetProcessHeap(), 0, pszNodes, dwNewPhysicalSize * sizeof(WCHAR));
229 else
230 pszNewNodes = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, dwNewPhysicalSize * sizeof(WCHAR));
231 if (!pszNewNodes)
232 goto done;
233
234 dwPhysicalSize = dwNewPhysicalSize;
235 pszNodes = pszNewNodes;
236 }
237
238 tvItem.mask = TVIF_TEXT;
239 tvItem.hItem = childItem;
240 tvItem.pszText = &pszNodes[dwActualSize];
241 tvItem.cchTextMax = dwPhysicalSize - dwActualSize;
242 if (!TreeView_GetItem(hwndTV, &tvItem))
243 goto done;
244
245 dwActualSize += (DWORD) wcslen(&pszNodes[dwActualSize]) + 1;
246 }
247
248 if (pszNodes)
249 pszNodes[dwActualSize] = L'\0';
250 }
251
252 /* Now go through all the children in the tree, and check if any have to be removed. */
253 childItem = TreeView_GetChild(hwndTV, hItem);
254 while (childItem)
255 {
256 HTREEITEM nextItem = TreeView_GetNextSibling(hwndTV, childItem);
257 if (RefreshTreeItem(hwndTV, childItem) == FALSE)
258 {
259 (void)TreeView_DeleteItem(hwndTV, childItem);
260 }
261 childItem = nextItem;
262 }
263
264 /* Now go through all the children in the registry, and check if any have to be added. */
265 bAddedAny = FALSE;
266 for (dwIndex = 0; dwIndex < dwCount; dwIndex++)
267 {
268 DWORD cName = dwMaxSubKeyLen, dwSubCount;
269 BOOL found;
270
271 found = FALSE;
272 if (RegEnumKeyExW(hKey, dwIndex, Name, &cName, 0, 0, 0, NULL) != ERROR_SUCCESS)
273 {
274 continue;
275 }
276
277 /* Check if the node is already in there. */
278 if (pszNodes)
279 {
280 for (s = pszNodes; *s; s += wcslen(s) + 1)
281 {
282 if (!wcscmp(s, Name))
283 {
284 found = TRUE;
285 break;
286 }
287 }
288 }
289
290 if (found == FALSE)
291 {
292 /* Find the number of children of the node. */
293 dwSubCount = 0;
294 if (RegOpenKeyExW(hKey, Name, 0, KEY_QUERY_VALUE, &hSubKey) == ERROR_SUCCESS)
295 {
296 if (RegQueryInfoKeyW(hSubKey, 0, 0, 0, &dwSubCount, 0, 0, 0, 0, 0, 0, 0) != ERROR_SUCCESS)
297 {
298 dwSubCount = 0;
299 }
300 RegCloseKey(hSubKey);
301 }
302
303 AddEntryToTree(hwndTV, hItem, Name, NULL, dwSubCount);
304 bAddedAny = TRUE;
305 }
306 }
308
309 if (bAddedAny)
311
312 bSuccess = TRUE;
313
314done:
315 if (pszNodes)
316 HeapFree(GetProcessHeap(), 0, pszNodes);
317 if (Name)
319 return bSuccess;
320}
BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
Definition: treeview.c:152
GLdouble s
Definition: gl.h:2039
#define DWORD
Definition: nt_native.h:44
#define TreeView_GetItemState(hwndTV, hti, mask)
Definition: commctrl.h:3595
#define TVIS_EXPANDED
Definition: commctrl.h:3284
HTREEITEM hItem
Definition: commctrl.h:3317

Referenced by RefreshTreeItem(), and RefreshTreeView().

◆ RefreshTreeView()

BOOL RefreshTreeView ( HWND  hwndTV)

Definition at line 322 of file treeview.c.

323{
325 HTREEITEM hSelectedItem;
326 HCURSOR hcursorOld;
327
328 hSelectedItem = TreeView_GetSelection(hwndTV);
329 hcursorOld = SetCursor(LoadCursor(NULL, IDC_WAIT));
330 SendMessageW(hwndTV, WM_SETREDRAW, FALSE, 0);
331
332 hItem = TreeView_GetChild(hwndTV, TreeView_GetRoot(hwndTV));
333 while (hItem)
334 {
335 RefreshTreeItem(hwndTV, hItem);
337 }
338
339 SendMessageW(hwndTV, WM_SETREDRAW, TRUE, 0);
340 SetCursor(hcursorOld);
341
342 /* We reselect the currently selected node, this will prompt a refresh of the listview. */
343 (void)TreeView_SelectItem(hwndTV, hSelectedItem);
344 return TRUE;
345}
#define TreeView_GetRoot(hwnd)
Definition: commctrl.h:3475

Referenced by _CmdWndProc(), ImportRegistryFile(), LoadHive(), and UnloadHive().

◆ SelectNode()

BOOL SelectNode ( HWND  hwndTV,
LPCWSTR  keyPath 
)

Definition at line 785 of file treeview.c.

786{
788 HTREEITEM hChildItem;
789 WCHAR szPathPart[128];
790 WCHAR szBuffer[128];
791 LPCWSTR s;
792 TVITEMW tvi;
793
794 /* Load "My Computer" string... */
795 LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, ARRAY_SIZE(szBuffer));
796 StringCbCatW(szBuffer, sizeof(szBuffer), L"\\");
797
798 /* ... and remove it from the key path */
799 if (!_wcsnicmp(keyPath, szBuffer, wcslen(szBuffer)))
800 keyPath += wcslen(szBuffer);
801
802 /* Reinitialize szBuffer */
803 szBuffer[0] = L'\0';
804
805 hRoot = TreeView_GetRoot(hwndTV);
806 hItem = hRoot;
807
808 while(keyPath[0])
809 {
810 size_t copyLength;
811 s = wcschr(keyPath, L'\\');
812 if (s != NULL)
813 {
814 copyLength = (s - keyPath) * sizeof(WCHAR);
815 }
816 else
817 {
818 copyLength = sizeof(szPathPart);
819 }
820 StringCbCopyNW(szPathPart, sizeof(szPathPart), keyPath, copyLength);
821
822 /* Special case for root to expand root key abbreviations */
823 if (hItem == hRoot)
824 {
825 if (!_wcsicmp(szPathPart, L"HKCR"))
826 StringCbCopyW(szPathPart, sizeof(szPathPart), L"HKEY_CLASSES_ROOT");
827 else if (!_wcsicmp(szPathPart, L"HKCU"))
828 StringCbCopyW(szPathPart, sizeof(szPathPart), L"HKEY_CURRENT_USER");
829 else if (!_wcsicmp(szPathPart, L"HKLM"))
830 StringCbCopyW(szPathPart, sizeof(szPathPart), L"HKEY_LOCAL_MACHINE");
831 else if (!_wcsicmp(szPathPart, L"HKU"))
832 StringCbCopyW(szPathPart, sizeof(szPathPart), L"HKEY_USERS");
833 else if (!_wcsicmp(szPathPart, L"HKCC"))
834 StringCbCopyW(szPathPart, sizeof(szPathPart), L"HKEY_CURRENT_CONFIG");
835 else if (!_wcsicmp(szPathPart, L"HKDD"))
836 StringCbCopyW(szPathPart, sizeof(szPathPart), L"HKEY_DYN_DATA");
837 }
838
839 for (hChildItem = TreeView_GetChild(hwndTV, hItem); hChildItem;
840 hChildItem = TreeView_GetNextSibling(hwndTV, hChildItem))
841 {
842 memset(&tvi, 0, sizeof(tvi));
843 tvi.hItem = hChildItem;
845 tvi.pszText = szBuffer;
846 tvi.cchTextMax = ARRAY_SIZE(szBuffer);
847
848 (void)TreeView_GetItem(hwndTV, &tvi);
849
850 if (!_wcsicmp(szBuffer, szPathPart))
851 break;
852 }
853
854 if (!hChildItem)
855 return FALSE;
856
857 if (tvi.cChildren > 0)
858 {
859 if (!TreeView_Expand(hwndTV, hChildItem, TVE_EXPAND))
860 return FALSE;
861 }
862
863 keyPath = s ? s + 1 : L"";
864 hItem = hChildItem;
865 }
866
869
870 return TRUE;
871}
#define IDS_MY_COMPUTER
Definition: resource.h:129
#define wcschr
Definition: compat.h:17
#define TreeView_EnsureVisible(hwnd, hitem)
Definition: commctrl.h:3545
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
STRSAFEAPI StringCbCopyNW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc, size_t cbToCopy)
Definition: strsafe.h:255
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342

Referenced by _CmdWndProc(), AddressBarProc(), ChooseFavorite(), FindNext(), and LoadSettings().

◆ StartKeyRename()

HWND StartKeyRename ( HWND  hwndTV)

Definition at line 399 of file treeview.c.

400{
402
403 if(!(hItem = TreeView_GetSelection(hwndTV))) return 0;
404 return TreeView_EditLabel(hwndTV, hItem);
405}

◆ TreeWndNotifyProc()

BOOL TreeWndNotifyProc ( HWND  hWnd,
WPARAM  wParam,
LPARAM  lParam,
BOOL Result 
)

Definition at line 641 of file treeview.c.

642{
644 *Result = TRUE;
645
646 switch (((LPNMHDR)lParam)->code)
647 {
650 return TRUE;
651 case TVN_SELCHANGED:
652 {
653 NMTREEVIEW* pnmtv = (NMTREEVIEW*)lParam;
654 /* Get the parent of the current item */
655 HTREEITEM hParentItem = TreeView_GetParent(g_pChildWnd->hTreeWnd, pnmtv->itemNew.hItem);
656
657 UpdateAddress(pnmtv->itemNew.hItem, NULL, NULL, TRUE);
658
659 /* Disable the Permissions and new key menu items for 'My Computer' */
662
663 /*
664 * Disable Delete/Rename menu options for 'My Computer' (first item so doesn't have any parent)
665 * and HKEY_* keys (their parent is 'My Computer' and the previous remark applies).
666 */
667 if (!hParentItem || !TreeView_GetParent(g_pChildWnd->hTreeWnd, hParentItem))
668 {
673 }
674 else
675 {
680 }
681
682 return TRUE;
683 }
684 case NM_SETFOCUS:
686 break;
688 {
690 /* cancel label edit for rootkeys */
691 if (!TreeView_GetParent(g_pChildWnd->hTreeWnd, ptvdi->item.hItem) ||
693 {
694 *Result = TRUE;
695 }
696 else
697 {
698 *Result = FALSE;
699 }
700 return TRUE;
701 }
702 case TVN_ENDLABELEDIT:
703 {
704 LPCWSTR keyPath;
705 HKEY hRootKey;
706 HKEY hKey = NULL;
708 LONG nRenResult;
709 LONG lResult = TRUE;
710 WCHAR szBuffer[MAX_PATH];
711 WCHAR Caption[128];
712
713 if (ptvdi->item.pszText)
714 {
715 keyPath = GetItemPath(g_pChildWnd->hTreeWnd, TreeView_GetParent(g_pChildWnd->hTreeWnd, ptvdi->item.hItem), &hRootKey);
716 if (wcslen(keyPath))
717 _snwprintf(szBuffer, ARRAY_SIZE(szBuffer), L"%s\\%s", keyPath, ptvdi->item.pszText);
718 else
719 _snwprintf(szBuffer, ARRAY_SIZE(szBuffer), L"%s", ptvdi->item.pszText);
720 keyPath = GetItemPath(g_pChildWnd->hTreeWnd, ptvdi->item.hItem, &hRootKey);
721 if (RegOpenKeyExW(hRootKey, szBuffer, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
722 {
723 lResult = FALSE;
725 TreeView_EditLabel(g_pChildWnd->hTreeWnd, ptvdi->item.hItem);
726 }
727 else
728 {
729 nRenResult = RenameKey(hRootKey, keyPath, ptvdi->item.pszText);
730 if (nRenResult != ERROR_SUCCESS)
731 {
732 LoadStringW(hInst, IDS_ERROR, Caption, ARRAY_SIZE(Caption));
733 ErrorMessageBox(hWnd, Caption, nRenResult);
734 lResult = FALSE;
735 }
736 else
737 UpdateAddress(ptvdi->item.hItem, hRootKey, szBuffer, FALSE);
738 }
739 *Result = lResult;
740 }
741 return TRUE;
742 }
743 }
744 return FALSE;
745}
HWND hWnd
Definition: settings.c:17
#define IDS_ERROR
Definition: resource.h:18
ChildWnd * g_pChildWnd
Definition: childwnd.c:24
VOID UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath, BOOL bSelectNone)
Definition: childwnd.c:243
LONG RenameKey(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpNewName)
Definition: edit.c:2105
int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode,...)
Definition: error.c:24
HMENU hPopupMenus
Definition: main.c:38
HMENU hMenuFrame
Definition: main.c:37
#define ID_EDIT_DELETE
Definition: resource.h:57
#define ID_EDIT_NEW_KEY
Definition: resource.h:63
#define ID_EDIT_RENAME
Definition: resource.h:58
#define ID_TREE_RENAME
Definition: resource.h:152
#define ID_TREE_DELETE
Definition: resource.h:151
#define ID_EDIT_PERMISSIONS
Definition: resource.h:150
BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW *pnmtv)
Definition: treeview.c:516
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define MAX_PATH
Definition: compat.h:34
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define TVN_SELCHANGED
Definition: commctrl.h:3735
#define TVN_BEGINLABELEDIT
Definition: commctrl.h:3743
#define TVN_ENDLABELEDIT
Definition: commctrl.h:3744
#define NMTREEVIEW
Definition: commctrl.h:3642
#define NM_SETFOCUS
Definition: commctrl.h:135
#define TVN_ITEMEXPANDING
Definition: commctrl.h:3738
#define LPNMTVDISPINFO
Definition: commctrl.h:3676
int nFocusPanel
Definition: main.h:68
HWND hTreeWnd
Definition: main.h:63
Definition: inflate.c:139
#define MF_BYCOMMAND
Definition: winuser.h:202
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_GRAYED
Definition: winuser.h:129
_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

Referenced by ChildWndProc().

Variable Documentation

◆ Image_Closed

int Image_Closed = 0
static

Definition at line 28 of file treeview.c.

Referenced by AddEntryToTree(), and InitTreeViewImageLists().

◆ Image_Open

int Image_Open = 0
static

Definition at line 27 of file treeview.c.

Referenced by AddEntryToTree(), and InitTreeViewImageLists().

◆ Image_Root

int Image_Root = 0
static

Definition at line 29 of file treeview.c.

Referenced by InitTreeViewImageLists(), and InitTreeViewItems().

◆ pathBuffer

LPWSTR pathBuffer
static

Definition at line 31 of file treeview.c.

Referenced by DestroyTreeView(), GetItemPath(), test_listbox_dlgdir(), and test_listbox_LB_DIR().