ReactOS 0.4.17-dev-1190-g4c812f4
childwnd.c
Go to the documentation of this file.
1/*
2 * Regedit child window
3 *
4 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
5 * Copyright (C) 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
7 */
8
9#include "regedit.h"
10#include <shldisp.h>
11#include <shlguid.h>
12
13#define IDM_GO_COMMAND 3001
14
16static int last_split = -1;
20
22{
23 if (ppv)
24 *ppv = NULL;
26 {
27 *ppv = This;
28 return S_OK;
29 }
30 return E_NOINTERFACE;
31}
32
34{
35 return 1;
36}
37
38static HRESULT WINAPI DummyEnumStringsNext(LPVOID This, ULONG celt, LPWSTR *parr, ULONG *pceltFetched)
39{
40 if (pceltFetched)
41 *pceltFetched = 0;
42 return S_FALSE;
43}
44
46{
47 return S_OK;
48}
49
51{
52 return S_OK;
53}
54
56{
57 return E_NOTIMPL;
58}
59
70};
71
76};
77
79{
80 if (hRootKey == HKEY_CLASSES_ROOT) return L"HKEY_CLASSES_ROOT";
81 if (hRootKey == HKEY_CURRENT_USER) return L"HKEY_CURRENT_USER";
82 if (hRootKey == HKEY_LOCAL_MACHINE) return L"HKEY_LOCAL_MACHINE";
83 if (hRootKey == HKEY_USERS) return L"HKEY_USERS";
84 if (hRootKey == HKEY_CURRENT_CONFIG) return L"HKEY_CURRENT_CONFIG";
85 if (hRootKey == HKEY_DYN_DATA) return L"HKEY_DYN_DATA";
86
87 return L"UNKNOWN HKEY, PLEASE REPORT";
88}
89
91{
92 RECT rc;
93 GetClientRect(hWnd, &rc);
94 return min(max(x, SPLIT_MIN), rc.right - SPLIT_MIN);
95}
96
97void ResizeWnd(int cx, int cy)
98{
99 HDWP hdwp;
100 RECT rt, rb, re;
101 TBBUTTONINFO tbInfo;
102 LONG nToolHeight;
103 INT cyBorder = GetSystemMetrics(SM_CYBORDER); // Part of FIXME below.
106
107 SetRect(&rt, 0, 0, cx, cy);
108 // Added in commit e6302ccd70 (PR #7747)
109 //GetClientRect(g_pChildWnd->hWnd, &rt);
110 //RedrawWindow(g_pChildWnd->hWnd, &rt, NULL, RDW_INVALIDATE | RDW_NOCHILDREN);
111
112 /* Use the Go-button height for the address toolbar height */
114 nToolHeight = rb.bottom - rb.top;
115
116 /* Resize the separator containing the address bar */
117 tbInfo.cbSize = sizeof(tbInfo);
118 tbInfo.dwMask = TBIF_BYINDEX | TBIF_SIZE;
119 tbInfo.cx = rt.right - rt.left - (rb.right - rb.left);
121 //SendMessageW(g_pChildWnd->hAddressToolBarWnd, TB_AUTOSIZE, 0, 0);
122 /* Resize the address bar */
125 re.left,
126 re.top + cyEdge,
127 re.right - re.left,
128 /*re.bottom - re.top*/nToolHeight - 2 * cyEdge,
129 uFlags);
130
131 cy = 0;
132#if 0 // FIXME: Re-enable once "childwnd" and "framewnd" are unified.
134 {
135 RECT rs;
137 cy = rs.bottom - rs.top;
138 }
139#endif
141
143 hdwp = BeginDeferWindowPos(3);
144 if (hdwp)
146 rt.left, rt.top,
147 rt.right - rt.left,
148 nToolHeight,
149 uFlags);
150 if (hdwp)
152 rt.left,
153 rt.top + nToolHeight,
155 rt.bottom - rt.top - cy - nToolHeight + cyBorder,
156 uFlags);
157 if (hdwp)
159 rt.left + cx,
160 rt.top + nToolHeight,
161 rt.right - cx,
162 rt.bottom - rt.top - cy - nToolHeight + cyBorder,
163 uFlags);
164 if (hdwp)
165 EndDeferWindowPos(hdwp);
166}
167
168/*******************************************************************************
169 * Local module support methods
170 */
171
172static void draw_splitbar(HWND hWnd, int x)
173{
174 RECT rt;
175 HGDIOBJ OldObj;
177
178 if(!SizingPattern)
179 {
180 const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA};
181 SizingPattern = CreateBitmap(8, 8, 1, 1, Pattern);
182 }
183 if(!SizingBrush)
184 {
186 }
187
189 MapWindowPoints(NULL, hWnd, (POINT *)&rt, sizeof(rt) / sizeof(POINT));
190
191 rt.left = x - SPLIT_WIDTH/2;
192 rt.right = x + SPLIT_WIDTH/2+1;
193 OldObj = SelectObject(hdc, SizingBrush);
194 PatBlt(hdc, rt.left, rt.top, rt.right - rt.left, rt.bottom - rt.top, PATINVERT);
195 SelectObject(hdc, OldObj);
197}
198
202static void finish_splitbar(HWND hWnd, int x)
203{
204 RECT rt;
205
207 last_split = -1;
208 GetClientRect(hWnd, &rt);
210 ResizeWnd(rt.right, rt.bottom);
211 InvalidateRect(hWnd, &rt, FALSE); // HACK: See CORE-19576
213}
214
215/*******************************************************************************
216 *
217 * Key suggestion
218 */
219
220#define MIN(a,b) ((a < b) ? (a) : (b))
221
222static void SuggestKeys(HKEY hRootKey, LPCWSTR pszKeyPath, LPWSTR pszSuggestions,
223 size_t iSuggestionsLength)
224{
225 WCHAR szBuffer[256];
226 WCHAR szLastFound[256];
227 size_t i;
228 HKEY hOtherKey, hSubKey;
229 BOOL bFound;
231
232 memset(pszSuggestions, 0, iSuggestionsLength * sizeof(*pszSuggestions));
233 iSuggestionsLength--;
234
235 /* Are we a root key in HKEY_CLASSES_ROOT? */
236 if ((hRootKey == HKEY_CLASSES_ROOT) && pszKeyPath[0] && !wcschr(pszKeyPath, L'\\'))
237 {
238 do
239 {
240 bFound = FALSE;
241
242 /* Check default key */
243 if (QueryStringValue(hRootKey, pszKeyPath, NULL,
244 szBuffer, ARRAY_SIZE(szBuffer)) == ERROR_SUCCESS)
245 {
246 /* Sanity check this key; it cannot be empty, nor can it be a
247 * loop back */
248 if ((szBuffer[0] != L'\0') && _wcsicmp(szBuffer, pszKeyPath))
249 {
250 if (RegOpenKeyExW(hRootKey, szBuffer, 0, regsam, &hOtherKey) == ERROR_SUCCESS)
251 {
252 lstrcpynW(pszSuggestions, L"HKCR\\", (int) iSuggestionsLength);
253 i = wcslen(pszSuggestions);
254 pszSuggestions += i;
255 iSuggestionsLength -= i;
256
257 lstrcpynW(pszSuggestions, szBuffer, (int) iSuggestionsLength);
258 i = MIN(wcslen(pszSuggestions) + 1, iSuggestionsLength);
259 pszSuggestions += i;
260 iSuggestionsLength -= i;
261 RegCloseKey(hOtherKey);
262
263 bFound = TRUE;
264 StringCbCopyW(szLastFound, sizeof(szLastFound), szBuffer);
265 pszKeyPath = szLastFound;
266 }
267 }
268 }
269 }
270 while(bFound && (iSuggestionsLength > 0));
271
272 /* Check CLSID key */
273 if (RegOpenKeyExW(hRootKey, pszKeyPath, 0, regsam, &hSubKey) == ERROR_SUCCESS)
274 {
275 if (QueryStringValue(hSubKey, L"CLSID", NULL, szBuffer,
276 ARRAY_SIZE(szBuffer)) == ERROR_SUCCESS)
277 {
278 lstrcpynW(pszSuggestions, L"HKCR\\CLSID\\", (int)iSuggestionsLength);
279 i = wcslen(pszSuggestions);
280 pszSuggestions += i;
281 iSuggestionsLength -= i;
282
283 lstrcpynW(pszSuggestions, szBuffer, (int)iSuggestionsLength);
284 i = MIN(wcslen(pszSuggestions) + 1, iSuggestionsLength);
285 pszSuggestions += i;
286 iSuggestionsLength -= i;
287 }
288 RegCloseKey(hSubKey);
289 }
290 }
291 else if ((hRootKey == HKEY_CURRENT_USER || hRootKey == HKEY_LOCAL_MACHINE) && *pszKeyPath)
292 {
293 LPCWSTR rootstr = hRootKey == HKEY_CURRENT_USER ? L"HKLM" : L"HKCU";
294 hOtherKey = hRootKey == HKEY_CURRENT_USER ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
295 if (RegOpenKeyExW(hOtherKey, pszKeyPath, 0, regsam, &hSubKey) == ERROR_SUCCESS)
296 {
297 int cch;
298 RegCloseKey(hSubKey);
299 cch = _snwprintf(pszSuggestions, iSuggestionsLength, L"%s\\%s", rootstr, pszKeyPath);
300 if (cch <= 0 || cch > iSuggestionsLength)
301 pszSuggestions[0] = UNICODE_NULL;
302 }
303 }
304}
305
307{
308 WNDPROC oldwndproc;
309 static WCHAR s_szNode[256];
311
312 switch (uMsg)
313 {
314 case WM_KEYUP:
315 if (wParam == VK_RETURN)
316 {
317 GetWindowTextW(hwnd, s_szNode, ARRAY_SIZE(s_szNode));
318 SelectNode(g_pChildWnd->hTreeWnd, s_szNode);
319 }
320 break;
321 default:
322 break;
323 }
324 return CallWindowProcW(oldwndproc, hwnd, uMsg, wParam, lParam);
325}
326
327VOID
328UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath, BOOL bSelectNone)
329{
330 LPCWSTR keyPath, rootName;
331 LPWSTR fullPath;
332 DWORD cbFullPath;
333
334 /* Wipe the listview, the status bar and the address bar if the root key was selected */
336 {
340 return;
341 }
342
343 if (pszPath == NULL)
344 keyPath = GetItemPath(g_pChildWnd->hTreeWnd, hItem, &hRootKey);
345 else
346 keyPath = pszPath;
347
348 if (keyPath)
349 {
350 RefreshListView(g_pChildWnd->hListWnd, hRootKey, keyPath, bSelectNone);
351 rootName = get_root_key_name(hRootKey);
352 cbFullPath = (wcslen(rootName) + 1 + wcslen(keyPath) + 1) * sizeof(WCHAR);
353 fullPath = malloc(cbFullPath);
354 if (fullPath)
355 {
356 /* set (correct) the address bar text */
357 if (keyPath[0] != UNICODE_NULL)
358 StringCbPrintfW(fullPath, cbFullPath, L"%s%s%s", rootName,
359 ((keyPath[0] == L'\\') ? L"" : L"\\"), keyPath);
360 else
361 StringCbCopyW(fullPath, cbFullPath, rootName);
362
365 free(fullPath);
366
367 /* disable hive manipulation items temporarily (enable only if necessary) */
370 /* compare the strings to see if we should enable/disable the "Load Hive" menus accordingly */
371 if (_wcsicmp(rootName, L"HKEY_LOCAL_MACHINE") == 0 ||
372 _wcsicmp(rootName, L"HKEY_USERS") == 0)
373 {
374 /*
375 * enable the unload menu item if at the root, otherwise
376 * enable the load menu item if there is no slash in
377 * keyPath (ie. immediate child selected)
378 */
379 if (keyPath[0] == UNICODE_NULL)
381 else if (!wcschr(keyPath, L'\\'))
383 }
384 }
385 }
386}
387
395{
396 BOOL Result;
397 RECT rc;
398
399 switch (message)
400 {
401 case WM_CREATE:
402 {
403 WNDPROC oldproc;
404 HFONT hFont;
406 DWORD style;
407 IAutoComplete *pAutoComplete;
408 const int iBitmap = 0;
409 TBBUTTON tbButtons[2] =
410 {
411 {0, -1, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
413 };
414
415 /* Load "My Computer" string */
417
419 if (!g_pChildWnd) return 0;
420
422 g_pChildWnd->nSplitPos = 190;
424
425 /* The horizontal line above the toolbar is hidden with the CCS_NODIVIDER style */
429 0, 0, 0, 0,
430 hWnd, NULL, hInst, NULL);
431
433 20, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
435 20, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
439
443
444 /* ES_AUTOHSCROLL style enables horizontal scrolling and shrinking */
447 0, 0, 0, 0,
449
450 if (SUCCEEDED(CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER, &IID_IAutoComplete, (void**)&pAutoComplete)))
451 {
452 IAutoComplete_Init(pAutoComplete, g_pChildWnd->hAddressBarWnd, (IUnknown*)&g_DummyEnumStrings, NULL, NULL);
453 IAutoComplete_Release(pAutoComplete);
454 }
455
456 GetClientRect(hWnd, &rc);
460
461 /* Set the address bar and button font */
463 {
467 (WPARAM)hFont,
468 0);
469 }
470 /* Subclass the address bar */
474 break;
475 }
476
477 case WM_COMMAND:
479 {
481 }
482 break; //goto def;
483
484 case WM_SETCURSOR:
485 if (LOWORD(lParam) == HTCLIENT)
486 {
487 POINT pt;
491 {
493 return TRUE;
494 }
495 }
496 goto def;
497
498 case WM_DESTROY:
507 break;
508
509 case WM_LBUTTONDOWN:
510 {
511 INT x = (SHORT)LOWORD(lParam);
512 if (x >= g_pChildWnd->nSplitPos - SPLIT_WIDTH / 2 &&
513 x < g_pChildWnd->nSplitPos + SPLIT_WIDTH / 2 + 1)
514 {
517 last_split = x;
519 }
520 break;
521 }
522
523 case WM_LBUTTONUP:
524 case WM_RBUTTONDOWN:
525 if (GetCapture() == hWnd)
526 {
527 INT x = (SHORT)LOWORD(lParam);
530 }
531 break;
532
534 if (GetCapture() == hWnd && last_split >= 0)
536 break;
537
538 case WM_KEYDOWN:
539 if (wParam == VK_ESCAPE)
540 if (GetCapture() == hWnd)
541 {
542 RECT rt;
544 GetClientRect(hWnd, &rt);
545 ResizeWnd(rt.right, rt.bottom);
546 last_split = -1;
549 }
550 break;
551
552 case WM_MOUSEMOVE:
553 if (GetCapture() == hWnd)
554 {
555 INT x = (SHORT)LOWORD(lParam);
557 if (last_split != x)
558 {
560 last_split = x;
562 }
563 }
564 break;
565
566 case WM_SETFOCUS:
567 if (g_pChildWnd != NULL)
568 {
570 }
571 break;
572
573 case WM_NOTIFY:
574 if (g_pChildWnd == NULL) break;
575
576 if (((LPNMHDR)lParam)->idFrom == TREE_WINDOW)
577 {
579 {
580 goto def;
581 }
582
583 return Result;
584 }
585 else
586 {
587 if (((LPNMHDR)lParam)->idFrom == LIST_WINDOW)
588 {
590 {
591 goto def;
592 }
593
594 return Result;
595 }
596 else
597 {
598 goto def;
599 }
600 }
601 break;
602
603 case WM_CONTEXTMENU:
604 {
605 POINT pt;
607 {
608 int i, cnt;
609 BOOL IsDefault;
610 pt.x = (short) LOWORD(lParam);
611 pt.y = (short) HIWORD(lParam);
614 if (pt.x == -1 && pt.y == -1)
615 {
616 RECT rc;
617 if (i != -1)
618 {
619 rc.left = LVIR_BOUNDS;
621 pt.x = rc.left + 8;
622 pt.y = rc.top + 8;
623 }
624 else
625 pt.x = pt.y = 0;
627 }
628 if(i == -1)
629 {
631 }
632 else
633 {
636 IsDefault = IsDefaultValue(g_pChildWnd->hListWnd, i);
637 if(cnt == 1)
639 else
643
645 }
646 }
647 else if ((HWND)wParam == g_pChildWnd->hTreeWnd)
648 {
649 TVHITTESTINFO hti;
650 HMENU hContextMenu;
652 MENUITEMINFOW mii;
653 WCHAR resource[256];
654 WCHAR buffer[256];
655 LPWSTR s;
656 LPCWSTR keyPath;
657 HKEY hRootKey;
658 int iLastPos;
659 WORD wID;
660 BOOL isRoot;
661
662 pt.x = (short) LOWORD(lParam);
663 pt.y = (short) HIWORD(lParam);
664
665 if (pt.x == -1 && pt.y == -1)
666 {
667 RECT rc;
669 if (hti.hItem != NULL)
670 {
672 pt.x = rc.left + 8;
673 pt.y = rc.top + 8;
675 hti.flags = TVHT_ONITEM;
676 }
677 else
678 hti.flags = 0;
679 }
680 else
681 {
682 hti.pt.x = pt.x;
683 hti.pt.y = pt.y;
686 }
687
688 if (hti.flags & TVHT_ONITEM)
689 {
691
692 isRoot = (TreeView_GetParent(g_pChildWnd->hTreeWnd, hti.hItem) == NULL);
693 hContextMenu = GetSubMenu(hPopupMenus, isRoot ? PM_ROOTITEM : PM_TREECONTEXT);
694
695 memset(&item, 0, sizeof(item));
697 item.hItem = hti.hItem;
699
700 /* Set the Expand/Collapse menu item appropriately */
702 memset(&mii, 0, sizeof(mii));
703 mii.cbSize = sizeof(mii);
705 mii.fState = (item.cChildren > 0) ? MFS_DEFAULT : MFS_GRAYED;
707 mii.dwTypeData = (LPWSTR) buffer;
708 SetMenuItemInfo(hContextMenu, 0, TRUE, &mii);
709
710 if (isRoot == FALSE)
711 {
712 /* Remove any existing suggestions */
713 memset(&mii, 0, sizeof(mii));
714 mii.cbSize = sizeof(mii);
715 mii.fMask = MIIM_ID;
716 GetMenuItemInfo(hContextMenu, GetMenuItemCount(hContextMenu) - 1, TRUE, &mii);
717 if ((mii.wID >= ID_TREE_SUGGESTION_MIN) && (mii.wID <= ID_TREE_SUGGESTION_MAX))
718 {
719 do
720 {
721 iLastPos = GetMenuItemCount(hContextMenu) - 1;
722 GetMenuItemInfo(hContextMenu, iLastPos, TRUE, &mii);
723 RemoveMenu(hContextMenu, iLastPos, MF_BYPOSITION);
724 }
725 while((mii.wID >= ID_TREE_SUGGESTION_MIN) && (mii.wID <= ID_TREE_SUGGESTION_MAX));
726 }
727
728 /* Come up with suggestions */
729 keyPath = GetItemPath(g_pChildWnd->hTreeWnd, NULL, &hRootKey);
730 SuggestKeys(hRootKey, keyPath, Suggestions, ARRAY_SIZE(Suggestions));
731 if (Suggestions[0])
732 {
733 AppendMenu(hContextMenu, MF_SEPARATOR, 0, NULL);
734
736
737 s = Suggestions;
739 while(*s && (wID <= ID_TREE_SUGGESTION_MAX))
740 {
741 WCHAR *path = s, buf[MAX_PATH];
742 if (hRootKey == HKEY_CURRENT_USER || hRootKey == HKEY_LOCAL_MACHINE)
743 {
744 // Windows 10 only displays the root name
746 if (next > s)
747 lstrcpynW(path = buf, s, min(next - s, _countof(buf)));
748 }
750
751 memset(&mii, 0, sizeof(mii));
752 mii.cbSize = sizeof(mii);
753 mii.fMask = MIIM_STRING | MIIM_ID;
754 mii.wID = wID++;
755 mii.dwTypeData = buffer;
756 InsertMenuItem(hContextMenu, GetMenuItemCount(hContextMenu), TRUE, &mii);
757
758 s += wcslen(s) + 1;
759 }
760 }
761 }
762 TrackPopupMenu(hContextMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL);
763 }
764 }
765 break;
766 }
767
768 case WM_SIZE:
770 {
772 }
773 break;
774
775 default:
776def:
778 }
779 return 0;
780}
int cyBorder
Definition: appswitch.c:54
LONG QueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTSTR pszBuffer, DWORD dwBufferLen)
Definition: settings.c:19
HWND hWnd
Definition: settings.c:17
BOOL CreateListView(PMAIN_WND_INFO Info)
Definition: listview.c:355
static void finish_splitbar(HWND hWnd, int x)
Definition: childwnd.c:202
static int last_split
Definition: childwnd.c:16
static void draw_splitbar(HWND hWnd, int x)
Definition: childwnd.c:172
LRESULT CALLBACK AddressBarProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: childwnd.c:306
HBRUSH SizingBrush
Definition: childwnd.c:18
LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: childwnd.c:394
static ULONG WINAPI DummyEnumStringsAddRefRelease(LPVOID This)
Definition: childwnd.c:33
#define MIN(a, b)
Definition: childwnd.c:220
struct DummyEnumStrings g_DummyEnumStrings
ChildWnd * g_pChildWnd
Definition: childwnd.c:15
static HRESULT WINAPI DummyEnumStringsQI(LPVOID This, REFIID riid, void **ppv)
Definition: childwnd.c:21
static INT ClampSplitBarX(HWND hWnd, INT x)
Definition: childwnd.c:90
static HRESULT WINAPI DummyEnumStringsNext(LPVOID This, ULONG celt, LPWSTR *parr, ULONG *pceltFetched)
Definition: childwnd.c:38
LPCWSTR get_root_key_name(HKEY hRootKey)
Definition: childwnd.c:78
static HRESULT WINAPI DummyEnumStringsReset(LPVOID This)
Definition: childwnd.c:50
static HRESULT WINAPI DummyEnumStringsClone(LPVOID This, void **ppv)
Definition: childwnd.c:55
HBITMAP SizingPattern
Definition: childwnd.c:17
struct DummyEnumStringsVtbl g_DummyEnumStringsVtbl
WCHAR Suggestions[256]
Definition: childwnd.c:19
VOID UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath, BOOL bSelectNone)
Definition: childwnd.c:328
static void SuggestKeys(HKEY hRootKey, LPCWSTR pszKeyPath, LPWSTR pszSuggestions, size_t iSuggestionsLength)
Definition: childwnd.c:222
#define IDM_GO_COMMAND
Definition: childwnd.c:13
static HRESULT WINAPI DummyEnumStringsSkip(LPVOID This, ULONG celt)
Definition: childwnd.c:45
void ResizeWnd(int cx, int cy)
Definition: childwnd.c:97
BOOL IsDefaultValue(HWND hwndLV, int i)
Definition: listview.c:95
BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath, BOOL bSelectNone)
Definition: listview.c:678
BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
Definition: listview.c:552
void DestroyListView(HWND hwndLV)
Definition: listview.c:662
HMENU hPopupMenus
Definition: main.c:25
HWND hFrameWnd
Definition: main.c:22
void DestroyMainMenu()
Definition: main.c:139
HMENU hMenuFrame
Definition: main.c:24
HWND hStatusBar
Definition: main.c:23
HFONT hFont
Definition: main.c:53
HWND CreateTreeView(HWND hwndParent, LPWSTR pHostName, HMENU id)
Definition: treeview.c:741
#define PM_TREECONTEXT
Definition: main.h:24
BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
Definition: treeview.c:774
#define ARRAY_SIZE(A)
Definition: main.h:20
#define LIST_WINDOW
Definition: main.h:15
#define SPLIT_MIN
Definition: main.h:18
BOOL TreeWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
Definition: treeview.c:622
#define TREE_WINDOW
Definition: main.h:14
#define PM_NEW
Definition: main.h:23
LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY *phRootKey)
Definition: treeview.c:73
#define PM_ROOTITEM
Definition: main.h:25
#define PM_MODIFYVALUE
Definition: main.h:22
#define ID_TREE_SUGGESTION_MIN
Definition: resource.h:111
#define IDS_MY_COMPUTER
Definition: resource.h:84
#define IDS_COLLAPSE
Definition: resource.h:146
#define ID_EDIT_MODIFY
Definition: resource.h:47
#define ID_REGISTRY_UNLOADHIVE
Definition: resource.h:67
#define IDB_GO_NORMAL
Definition: resource.h:53
#define ID_TREE_EXPANDBRANCH
Definition: resource.h:64
#define ID_TREE_COLLAPSEBRANCH
Definition: resource.h:65
#define IDS_GO
Definition: resource.h:150
#define IDS_GOTO_SUGGESTED_KEY
Definition: resource.h:149
#define ID_EDIT_MODIFY_BIN
Definition: resource.h:77
#define IDS_EXPAND
Definition: resource.h:145
#define ID_TREE_SUGGESTION_MAX
Definition: resource.h:112
#define ID_EDIT_RENAME
Definition: resource.h:43
#define ID_REGISTRY_LOADHIVE
Definition: resource.h:66
#define IDB_GO_HOT
Definition: resource.h:54
const GUID IID_IUnknown
#define RegCloseKey(hKey)
Definition: registry.h:49
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#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:3333
UINT uFlags
Definition: api.c:59
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, COLORREF clrMask, UINT uType, UINT uFlags)
Definition: imagelist.c:2226
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define lstrcpynW
Definition: compat.h:738
WCHAR *WINAPI PathFindNextComponentW(const WCHAR *path)
Definition: path.c:2224
_ACRTIMP int __cdecl _snwprintf(wchar_t *, size_t, const wchar_t *,...)
Definition: wcs.c:1498
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:164
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define pt(x, y)
Definition: drawing.c:79
#define RGB(r, g, b)
Definition: precomp.h:88
#define L(x)
Definition: resources.c:13
HINSTANCE hInst
Definition: dxdiag.c:13
#define SPLIT_WIDTH
Definition: eventvwr.c:45
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLdouble s
Definition: gl.h:2039
GLuint buffer
Definition: glext.h:5915
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
unsigned int UINT
Definition: sysinfo.c:13
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define min(a, b)
Definition: monoChain.cc:55
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1022
#define UNICODE_NULL
const GUID IID_IEnumString
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_TABSTOP
Definition: pedump.c:634
short WCHAR
Definition: pedump.c:58
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define WS_VISIBLE
Definition: pedump.c:620
short SHORT
Definition: pedump.c:59
long LONG
Definition: pedump.c:60
static VOID DestroyTreeView(HWND hTreeView)
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TBIF_SIZE
Definition: commctrl.h:1225
#define BTNS_SHOWTEXT
Definition: commctrl.h:1006
#define BTNS_AUTOSIZE
Definition: commctrl.h:1004
#define TreeView_SelectItem(hwnd, hitem)
Definition: commctrl.h:3486
#define TVHT_ONITEM
Definition: commctrl.h:3532
#define LVNI_SELECTED
Definition: commctrl.h:2429
#define WC_EDITW
Definition: commctrl.h:4692
#define TBBUTTONINFO
Definition: commctrl.h:1254
#define BTNS_SEP
Definition: commctrl.h:999
#define TBSTYLE_LIST
Definition: commctrl.h:993
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
#define LVNI_FOCUSED
Definition: commctrl.h:2428
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TreeView_GetParent(hwnd, hitem)
Definition: commctrl.h:3474
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2439
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3478
#define TreeView_GetItem(hwnd, pitem)
Definition: commctrl.h:3495
#define TreeView_GetItemRect(hwnd, hitem, prc, code)
Definition: commctrl.h:3434
#define TB_ADDSTRINGW
Definition: commctrl.h:1132
#define TB_SETIMAGELIST
Definition: commctrl.h:1150
#define ListView_GetSelectedCount(hwndLV)
Definition: commctrl.h:2714
#define CCS_NODIVIDER
Definition: commctrl.h:2253
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define CCS_TOP
Definition: commctrl.h:2247
#define LVM_GETITEMRECT
Definition: commctrl.h:2482
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2419
#define TB_GETITEMRECT
Definition: commctrl.h:1133
#define TVIS_EXPANDED
Definition: commctrl.h:3289
#define TBIF_BYINDEX
Definition: commctrl.h:1226
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2251
#define CCS_NORESIZE
Definition: commctrl.h:2250
#define SB_SETTEXTW
Definition: commctrl.h:1947
#define TB_SETBUTTONINFO
Definition: commctrl.h:1263
#define TB_SETHOTIMAGELIST
Definition: commctrl.h:1154
#define TB_ADDBUTTONSW
Definition: commctrl.h:1266
#define TVIF_CHILDREN
Definition: commctrl.h:3277
#define TreeView_HitTest(hwnd, lpht)
Definition: commctrl.h:3518
#define TB_SETMAXTEXTROWS
Definition: commctrl.h:1162
#define TVIF_STATE
Definition: commctrl.h:3274
#define LVIR_BOUNDS
Definition: commctrl.h:2477
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
HWND WINAPI SetCapture(_In_ HWND hWnd)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define MF_BYCOMMAND
Definition: winuser.h:202
#define IMAGE_BITMAP
Definition: winuser.h:211
#define MIIM_STRING
Definition: winuser.h:738
#define SM_CYEDGE
Definition: winuser.h:1020
#define MIIM_ID
Definition: winuser.h:733
#define WM_KEYUP
Definition: winuser.h:1744
#define DCX_CACHE
Definition: winuser.h:2150
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define AppendMenu
Definition: winuser.h:5897
#define WM_CAPTURECHANGED
Definition: winuser.h:1836
#define TPM_RIGHTBUTTON
Definition: winuser.h:2416
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1636
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1639
#define LR_CREATEDIBSECTION
Definition: winuser.h:1109
#define WM_COMMAND
Definition: winuser.h:1768
#define IDC_ARROW
Definition: winuser.h:695
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3074
#define InsertMenuItem
Definition: winuser.h:5970
#define WM_SETFOCUS
Definition: winuser.h:1641
#define SetMenuItemInfo
Definition: winuser.h:6016
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_MOUSEMOVE
Definition: winuser.h:1803
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
HWND WINAPI GetCapture(void)
Definition: message.c:2881
#define SIZE_MINIMIZED
Definition: winuser.h:2542
#define WM_LBUTTONDOWN
Definition: winuser.h:1804
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2474
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define MIIM_STATE
Definition: winuser.h:732
#define MFS_DEFAULT
Definition: winuser.h:759
#define WM_RBUTTONDOWN
Definition: winuser.h:1807
#define WM_SETTEXT
Definition: winuser.h:1645
#define SM_CYBORDER
Definition: winuser.h:976
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define VK_RETURN
Definition: winuser.h:2237
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define MF_ENABLED
Definition: winuser.h:128
#define MFS_GRAYED
Definition: winuser.h:762
#define MF_SEPARATOR
Definition: winuser.h:137
#define SWP_NOCOPYBITS
Definition: winuser.h:1254
#define WM_SETFONT
Definition: winuser.h:1678
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 MF_BYPOSITION
Definition: winuser.h:203
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define HTCLIENT
Definition: winuser.h:2511
#define WM_LBUTTONUP
Definition: winuser.h:1805
#define WM_SETCURSOR
Definition: winuser.h:1664
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define BN_CLICKED
Definition: winuser.h:1954
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define WM_DESTROY
Definition: winuser.h:1637
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define WM_KEYDOWN
Definition: winuser.h:1743
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:3014
#define SWP_NOZORDER
Definition: winuser.h:1258
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_SIZEWE
Definition: winuser.h:702
#define GetMenuItemInfo
Definition: winuser.h:5954
#define VK_ESCAPE
Definition: winuser.h:2250
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
HDWP WINAPI BeginDeferWindowPos(_In_ int)
#define MF_GRAYED
Definition: winuser.h:129
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define MF_DISABLED
Definition: winuser.h:130
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
wcsncpy
#define LoadStringW
Definition: utils.h:64
#define memset(x, y, z)
Definition: compat.h:39
_In_ UINT _In_ UINT cch
Definition: shellapi.h:428
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
Definition: main.h:48
int nSplitPos
Definition: main.h:57
WCHAR szPath[MAX_PATH]
Definition: main.h:59
int nFocusPanel
Definition: main.h:56
HWND hTreeWnd
Definition: main.h:50
HIMAGELIST hGoButtonHot
Definition: main.h:55
HIMAGELIST hGoButtonNormal
Definition: main.h:54
HWND hListWnd
Definition: main.h:51
HWND hAddressBarWnd
Definition: main.h:53
HWND hAddressToolBarWnd
Definition: main.h:52
HWND hWnd
Definition: main.h:49
struct DummyEnumStringsVtbl * lpVtbl
Definition: childwnd.c:73
long y
Definition: dcommon.idl:24
long x
Definition: dcommon.idl:24
Definition: dcommon.idl:28
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
INT_PTR iString
Definition: commctrl.h:959
Definition: tftpd.h:60
Definition: style.c:91
LPWSTR dwTypeData
Definition: winuser.h:3377
HTREEITEM hItem
Definition: commctrl.h:3526
#define max(a, b)
Definition: svc.c:63
PSYMCRYPT_PARALLEL_HASH_OPERATION next
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint32_t DWORD_PTR
Definition: typedefs.h:65
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
_In_ size_t cnt
Definition: wcstombs.cpp:43
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
HGDIOBJ WINAPI GetStockObject(_In_ int)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
#define PATINVERT
Definition: wingdi.h:328
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBRUSH WINAPI CreatePatternBrush(_In_ HBITMAP)
#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
ACCESS_MASK REGSAM
Definition: winreg.h:76
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define HKEY_USERS
Definition: winreg.h:13
_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