ReactOS 0.4.16-dev-1109-gd06d9f3
framewnd.c
Go to the documentation of this file.
1/*
2 * Regedit frame window
3 *
4 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
5 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
6 */
7
8#include "regedit.h"
9
10#include <commdlg.h>
11#include <cderr.h>
12#include <objsel.h>
13
14#define FAVORITES_MENU_POSITION 3
15static WCHAR s_szFavoritesRegKey[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit\\Favorites";
16static BOOL bInMenuLoop = FALSE; /* Tells us if we are in the menu loop */
17extern WCHAR Suggestions[256];
18
20{
21 WCHAR buf[400];
23 NULL, Error, 0, buf, _countof(buf), NULL))
24 *(UINT*)buf = L'?';
26 return Error;
27}
28
29static void resize_frame_rect(HWND hWnd, PRECT prect)
30{
32 {
33 RECT rt;
34
37 prect->bottom -= rt.bottom - rt.top;
38 }
39 MoveWindow(g_pChildWnd->hWnd, prect->left, prect->top, prect->right, prect->bottom, TRUE);
40}
41
43{
44 RECT rect;
45
48}
49
50static void OnInitMenu(HWND hWnd)
51{
52 LONG lResult;
53 HKEY hKey = NULL;
54 DWORD dwIndex, cbValueName, cbValueData, dwType;
55 WCHAR szValueName[256];
56 BYTE abValueData[256];
57 static int s_nFavoriteMenuSubPos = -1;
58 HMENU hMenu;
59 BOOL bDisplayedAny = FALSE;
60 HTREEITEM hSelTreeItem;
61 BOOL bCanAddFav;
62
63 /* Find Favorites menu and clear it out */
65 if (!hMenu)
66 goto done;
67 if (s_nFavoriteMenuSubPos < 0)
68 {
69 s_nFavoriteMenuSubPos = GetMenuItemCount(hMenu);
70 }
71 else
72 {
73 while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION)) ;
74 }
75
77 bCanAddFav = TreeView_GetParent(g_pChildWnd->hTreeWnd, hSelTreeItem) != NULL;
79 MF_BYCOMMAND | (bCanAddFav ? MF_ENABLED : MF_GRAYED));
80
82 if (lResult != ERROR_SUCCESS)
83 goto done;
84
85 dwIndex = 0;
86 do
87 {
88 cbValueName = ARRAY_SIZE(szValueName);
89 cbValueData = sizeof(abValueData);
90 lResult = RegEnumValueW(hKey, dwIndex, szValueName, &cbValueName, NULL, &dwType, abValueData, &cbValueData);
91 if ((lResult == ERROR_SUCCESS) && (dwType == REG_SZ))
92 {
93 if (!bDisplayedAny)
94 {
95 AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
96 bDisplayedAny = TRUE;
97 }
98 AppendMenu(hMenu, 0, ID_FAVORITES_MIN + GetMenuItemCount(hMenu), szValueName);
99 }
100 dwIndex++;
101 }
102 while(lResult == ERROR_SUCCESS);
103
104done:
105 if (hKey)
107}
108
110{
111 int nParts;
113
114 /* Update the status bar pane sizes */
115 nParts = -1;
119}
120
122{
124 /* Update the status bar pane sizes*/
127}
128
129static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
130{
131 WCHAR str[100];
132
133 str[0] = UNICODE_NULL;
134 if (nFlags & MF_POPUP)
135 {
136 if (hSysMenu != GetMenu(hWnd))
137 {
138 if (nItemID == 2) nItemID = 5;
139 }
140 }
141 if (LoadStringW(hInst, nItemID, str, 100))
142 {
143 /* load appropriate string*/
144 LPWSTR lpsz = str;
145 /* first newline terminates actual string*/
146 lpsz = wcschr(lpsz, L'\n');
147 if (lpsz != NULL)
148 *lpsz = L'\0';
149 }
151}
152
154{
155 RECT rc;
156 int nParts;
157 GetClientRect(hWnd, &rc);
158 nParts = rc.right;
159 /* nParts = -1;*/
160 if (bResize)
163}
164
166{
167 HKEY hKeyRoot;
168 LPCWSTR pszKeyPath, pszRootName;
169 LPWSTR pszFullPath;
170 DWORD dwCbFullPath;
171
172 pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
173 if (!pszKeyPath)
174 return;
175
176 pszRootName = get_root_key_name(hKeyRoot);
177 dwCbFullPath = (wcslen(pszRootName) + 1 + wcslen(pszKeyPath) + 1) * sizeof(WCHAR);
178 pszFullPath = malloc(dwCbFullPath);
179 if (!pszFullPath)
180 return;
181
182 if (pszKeyPath[0] != UNICODE_NULL)
183 {
184 StringCbPrintfW(pszFullPath, dwCbFullPath, L"%s%s%s", pszRootName,
185 ((pszKeyPath[0] == L'\\') ? L"" : L"\\"), pszKeyPath);
186 }
187 else
188 {
189 StringCbCopyW(pszFullPath, dwCbFullPath, pszRootName);
190 }
191
192 SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)pszFullPath);
193 free(pszFullPath);
194}
195
196static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
197{
198 BOOL vis = IsWindowVisible(hchild);
200
202 ShowWindow(hchild, vis?SW_HIDE:SW_SHOW);
204}
205
207{
208 DWORD dwErrorCode = CommDlgExtendedError();
210 switch (dwErrorCode)
211 {
213 break;
215 break;
217 break;
219 break;
220 case CDERR_NOHOOK:
221 break;
223 break;
224 case CDERR_NOTEMPLATE:
225 break;
227 break;
228 case CDERR_STRUCTSIZE:
229 break;
231 break;
233 break;
235 break;
237 break;
239 break;
241 break;
242 default:
243 break;
244 }
245 return TRUE;
246}
247
249
250typedef struct
251{
255
256void
258{
259 int i, c;
260
261 c = 0;
262 for(i = 0; i < PairCount; i++)
263 {
264 c += LoadStringW(hInst, Pairs[i].DisplayID, &Filter[c], 255);
265 Filter[++c] = L'\0';
266 c += LoadStringW(hInst, Pairs[i].FilterID, &Filter[c], 255);
267 Filter[++c] = L'\0';
268 }
269 Filter[++c] = L'\0';
270}
271
273{
274 FILTERPAIR FilterPairs[5];
275 static WCHAR Filter[1024];
276
277 memset(pofn, 0, sizeof(OPENFILENAME));
278 pofn->lStructSize = sizeof(OPENFILENAME);
279 pofn->hwndOwner = hWnd;
280 pofn->hInstance = hInst;
281
282 /* create filter string */
283 FilterPairs[0].DisplayID = IDS_FLT_REGFILES;
284 FilterPairs[0].FilterID = IDS_FLT_REGFILES_FLT;
285 FilterPairs[1].DisplayID = IDS_FLT_HIVFILES;
286 FilterPairs[1].FilterID = IDS_FLT_HIVFILES_FLT;
287 FilterPairs[2].DisplayID = IDS_FLT_REGEDIT4;
288 FilterPairs[2].FilterID = IDS_FLT_REGEDIT4_FLT;
289 if (bSave)
290 {
291 FilterPairs[3].DisplayID = IDS_FLT_TXTFILES;
292 FilterPairs[3].FilterID = IDS_FLT_TXTFILES_FLT;
293 FilterPairs[4].DisplayID = IDS_FLT_ALLFILES;
294 FilterPairs[4].FilterID = IDS_FLT_ALLFILES_FLT;
295 }
296 else
297 {
298 FilterPairs[3].DisplayID = IDS_FLT_ALLFILES;
299 FilterPairs[3].FilterID = IDS_FLT_ALLFILES_FLT;
300 }
301
302 BuildFilterStrings(Filter, FilterPairs, ARRAY_SIZE(FilterPairs) - !bSave);
303
304 pofn->lpstrFilter = Filter;
308 pofn->lpstrDefExt = L"reg";
309 if (bSave)
311 else
312 pofn->Flags |= OFN_FILEMUSTEXIST;
313
314 return TRUE;
315}
316
317#define LOADHIVE_KEYNAMELENGTH 128
318
320{
321 static LPWSTR sKey = NULL;
322 switch(uMsg)
323 {
324 case WM_INITDIALOG:
325 sKey = (LPWSTR)lParam;
326 break;
327 case WM_COMMAND:
328 switch(LOWORD(wParam))
329 {
330 case IDOK:
332 return EndDialog(hWndDlg, -1);
333 else
334 return EndDialog(hWndDlg, 0);
335 case IDCANCEL:
336 return EndDialog(hWndDlg, 0);
337 }
338 break;
339 }
340 return FALSE;
341}
342
343static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, LPCWSTR lpszSystemName, BOOL bEnablePrivilege)
344{
345 BOOL bRet = FALSE;
346 HANDLE hToken = NULL;
347
350 &hToken))
351 {
353
354 tp.PrivilegeCount = 1;
355 tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
356
357 if (LookupPrivilegeValueW(lpszSystemName,
358 lpszPrivilegeName,
359 &tp.Privileges[0].Luid))
360 {
361 bRet = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
362
364 bRet = FALSE;
365 }
366
367 CloseHandle(hToken);
368 }
369
370 return bRet;
371}
372
374{
376 WCHAR Caption[128];
377 LPCWSTR pszKeyPath;
379 HKEY hRootKey;
380 WCHAR Filter[1024];
382 /* get the item key to load the hive in */
383 pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
384 /* initialize the "open file" dialog */
386 /* build the "All Files" filter up */
387 filter.DisplayID = IDS_FLT_ALLFILES;
388 filter.FilterID = IDS_FLT_ALLFILES_FLT;
391 /* load and set the caption and flags for dialog */
392 LoadStringW(hInst, IDS_LOAD_HIVE, Caption, ARRAY_SIZE(Caption));
393 ofn.lpstrTitle = Caption;
395
396 /* now load the hive */
397 if (GetOpenFileName(&ofn))
398 {
401 {
402 LONG regLoadResult;
403
404 /* Enable the 'restore' privilege, load the hive, disable the privilege */
406 regLoadResult = RegLoadKeyW(hRootKey, xPath, ofn.lpstrFile);
408
409 if(regLoadResult == ERROR_SUCCESS)
410 {
411 /* refresh tree and list views */
413 pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
414 RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath, TRUE);
415 }
416 else
417 {
418 ErrorMessageBox(hWnd, Caption, regLoadResult);
419 return FALSE;
420 }
421 }
422 }
423 else
424 {
426 }
427 return TRUE;
428}
429
431{
432 WCHAR Caption[128];
433 LPCWSTR pszKeyPath;
434 HKEY hRootKey;
435 LONG regUnloadResult;
436
437 /* get the item key to unload */
438 pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
439 /* load and set the caption and flags for dialog */
440 LoadStringW(hInst, IDS_UNLOAD_HIVE, Caption, ARRAY_SIZE(Caption));
441
442 /* Enable the 'restore' privilege, unload the hive, disable the privilege */
444 regUnloadResult = RegUnLoadKeyW(hRootKey, pszKeyPath);
446
447 if(regUnloadResult == ERROR_SUCCESS)
448 {
449 /* refresh tree and list views */
451 pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
452 RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath, TRUE);
453 }
454 else
455 {
456 ErrorMessageBox(hWnd, Caption, regUnloadResult);
457 return FALSE;
458 }
459 return TRUE;
460}
461
463{
464 BOOL bRet = FALSE;
466 WCHAR Caption[128], szTitle[512], szText[512];
467 HKEY hKeyRoot;
468 LPCWSTR pszKeyPath;
469
470 /* Figure out in which key path we are importing */
471 pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
472
474 LoadStringW(hInst, IDS_IMPORT_REG_FILE, Caption, ARRAY_SIZE(Caption));
475 ofn.lpstrTitle = Caption;
477
478 if (GetOpenFileName(&ofn))
479 {
480 /* Look at the extension of the file to determine its type */
481 if (ofn.nFileExtension >= 1 &&
482 _wcsicmp(ofn.lpstrFile + ofn.nFileExtension, L"reg") == 0) /* REGEDIT4 or Windows Registry Editor Version 5.00 */
483 {
484 /* Open the file */
485 FILE* fp = _wfopen(ofn.lpstrFile, L"rb");
486
487 /* Import it */
488 if (fp == NULL || !import_registry_file(fp))
489 {
490 /* Error opening the file */
492 LoadStringW(hInst, IDS_IMPORT_ERROR, szText, ARRAY_SIZE(szText));
494 bRet = FALSE;
495 }
496 else
497 {
498 /* Show successful import */
500 LoadStringW(hInst, IDS_IMPORT_OK, szText, ARRAY_SIZE(szText));
502 bRet = TRUE;
503 }
504
505 /* Close the file */
506 if (fp) fclose(fp);
507 }
508 else /* Registry Hive Files */
509 {
512
513 /* Display a confirmation message */
515 {
516 LONG lResult;
517 HKEY hSubKey;
518
519 /* Open the subkey */
520 lResult = RegOpenKeyExW(hKeyRoot, pszKeyPath, 0, KEY_WRITE, &hSubKey);
521 if (lResult == ERROR_SUCCESS)
522 {
523 /* Enable the 'restore' privilege, restore the hive then disable the privilege */
525 lResult = RegRestoreKey(hSubKey, ofn.lpstrFile, REG_FORCE_RESTORE);
527
528 /* Flush the subkey and close it */
529 RegFlushKey(hSubKey);
530 RegCloseKey(hSubKey);
531 }
532
533 /* Set the return value */
534 bRet = (lResult == ERROR_SUCCESS);
535
536 /* Display error, if any */
537 if (!bRet) ErrorMessageBox(hWnd, Caption, lResult);
538 }
539 }
540 }
541 else
542 {
544 }
545
546 /* refresh tree and list views */
548 pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
549 RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, pszKeyPath, TRUE);
550
551 return bRet;
552}
553
555{
556 HWND hwndExportAll;
557 HWND hwndExportBranch;
558 HWND hwndExportBranchText;
559 UINT_PTR iResult = 0;
560 OPENFILENAME *pOfn;
561 LPWSTR pszSelectedKey;
562 OFNOTIFY *pOfnNotify;
563
565
566 switch(uiMsg)
567 {
568 case WM_INITDIALOG:
569 pOfn = (OPENFILENAME *) lParam;
570 pszSelectedKey = (LPWSTR) pOfn->lCustData;
571
572 hwndExportAll = GetDlgItem(hdlg, IDC_EXPORT_ALL);
573 if (hwndExportAll)
574 SendMessageW(hwndExportAll, BM_SETCHECK, pszSelectedKey ? BST_UNCHECKED : BST_CHECKED, 0);
575
576 hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
577 if (hwndExportBranch)
578 SendMessageW(hwndExportBranch, BM_SETCHECK, pszSelectedKey ? BST_CHECKED : BST_UNCHECKED, 0);
579
580 hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
581 if (hwndExportBranchText)
582 SetWindowTextW(hwndExportBranchText, pszSelectedKey);
583 break;
584
585 case WM_NOTIFY:
586 if (((NMHDR *) lParam)->code == CDN_FILEOK)
587 {
588 pOfnNotify = (OFNOTIFY *) lParam;
589 pszSelectedKey = (LPWSTR) pOfnNotify->lpOFN->lCustData;
590
591 hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
592 hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
593 if (hwndExportBranch && hwndExportBranchText
594 && (SendMessageW(hwndExportBranch, BM_GETCHECK, 0, 0) == BST_CHECKED))
595 {
596 GetWindowTextW(hwndExportBranchText, pszSelectedKey, _MAX_PATH);
597 }
598 else if (pszSelectedKey)
599 {
600 pszSelectedKey[0] = L'\0';
601 }
602 }
603 break;
604 }
605 return iResult;
606}
607
609{
610 BOOL bRet = FALSE;
612 WCHAR ExportKeyPath[_MAX_PATH] = {0};
613 WCHAR Caption[128], szTitle[512], szText[512];
614 HKEY hKeyRoot;
615 LPCWSTR pszKeyPath;
616
617 /* Figure out which key path we are exporting */
618 pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
619 GetKeyName(ExportKeyPath, ARRAY_SIZE(ExportKeyPath), hKeyRoot, pszKeyPath);
620
622 LoadStringW(hInst, IDS_EXPORT_REG_FILE, Caption, ARRAY_SIZE(Caption));
623 ofn.lpstrTitle = Caption;
624
625 /* Only set the path if a key (not the root node) is selected */
626 if (hKeyRoot != 0)
627 {
628 ofn.lCustData = (LPARAM) ExportKeyPath;
629 }
633 if (GetSaveFileName(&ofn))
634 {
635 switch (ofn.nFilterIndex)
636 {
637 case 2: /* Registry Hive Files */
638 {
639 LONG lResult;
640 HKEY hSubKey;
641
642 /* Open the subkey */
643 lResult = RegOpenKeyExW(hKeyRoot, pszKeyPath, 0, KEY_READ, &hSubKey);
644 if (lResult == ERROR_SUCCESS)
645 {
646 /* Enable the 'backup' privilege, save the hive then disable the privilege */
648 lResult = RegSaveKeyW(hSubKey, ofn.lpstrFile, NULL);
649 if (lResult == ERROR_ALREADY_EXISTS)
650 {
651 /*
652 * We are here, that means that we already said "yes" to the confirmation dialog.
653 * So we absolutely want to replace the hive file.
654 */
656 {
657 /* Try again */
658 lResult = RegSaveKeyW(hSubKey, ofn.lpstrFile, NULL);
659 }
660 }
662
663 if (lResult != ERROR_SUCCESS)
664 {
665 /*
666 * If we are here, it's because RegSaveKeyW has failed for any reason.
667 * The problem is that even if it has failed, it has created or
668 * replaced the exported hive file with a new empty file. We don't
669 * want to keep this file, so we delete it.
670 */
672 }
673
674 /* Close the subkey */
675 RegCloseKey(hSubKey);
676 }
677
678 /* Set the return value */
679 bRet = (lResult == ERROR_SUCCESS);
680
681 /* Display error, if any */
682 if (!bRet) ErrorMessageBox(hWnd, Caption, lResult);
683
684 break;
685 }
686
687 case 1: /* Windows Registry Editor Version 5.00 */
688 case 3: /* REGEDIT4 */
689 default: /* All files ==> use Windows Registry Editor Version 5.00 */
690 {
691 if (!export_registry_key(ofn.lpstrFile, ExportKeyPath,
693 : REG_FORMAT_5)))
694 {
695 /* Error creating the file */
697 LoadStringW(hInst, IDS_EXPORT_ERROR, szText, ARRAY_SIZE(szText));
699 bRet = FALSE;
700 }
701 else
702 {
703 bRet = TRUE;
704 }
705
706 break;
707 }
708
709 case 4: /* Text File */
710 {
711 bRet = txt_export_registry_key(ofn.lpstrFile, ExportKeyPath);
712 if (!bRet)
713 {
714 /* Error creating the file */
716 LoadStringW(hInst, IDS_EXPORT_ERROR, szText, ARRAY_SIZE(szText));
718 }
719 break;
720 }
721 }
722 }
723 else
724 {
726 }
727
728 return bRet;
729}
730
732{
733#if 1
734 PRINTDLG pd;
736
737 ZeroMemory(&pd, sizeof(PRINTDLG));
738 pd.lStructSize = sizeof(PRINTDLG);
739 pd.hwndOwner = hWnd;
740 pd.hDevMode = NULL; /* Don't forget to free or store hDevMode*/
741 pd.hDevNames = NULL; /* Don't forget to free or store hDevNames*/
743 pd.nCopies = 1;
744 pd.nFromPage = 0xFFFF;
745 pd.nToPage = 0xFFFF;
746 pd.nMinPage = 1;
747 pd.nMaxPage = 0xFFFF;
748 if (PrintDlg(&pd))
749 {
750 /* GDI calls to render output. */
751 DeleteDC(pd.hDC); /* Delete DC when done.*/
752 }
753#else
754 HRESULT hResult;
755 PRINTDLGEX pd;
756
757 hResult = PrintDlgEx(&pd);
758 if (hResult == S_OK)
759 {
760 switch (pd.dwResultAction)
761 {
762 case PD_RESULT_APPLY:
763 /*The user clicked the Apply button and later clicked the Cancel button. This indicates that the user wants to apply the changes made in the property sheet, but does not yet want to print. The PRINTDLGEX structure contains the information specified by the user at the time the Apply button was clicked. */
764 break;
765 case PD_RESULT_CANCEL:
766 /*The user clicked the Cancel button. The information in the PRINTDLGEX structure is unchanged. */
767 break;
768 case PD_RESULT_PRINT:
769 /*The user clicked the Print button. The PRINTDLGEX structure contains the information specified by the user. */
770 break;
771 default:
772 break;
773 }
774 }
775 else
776 {
777 switch (hResult)
778 {
779 case E_OUTOFMEMORY:
780 /*Insufficient memory. */
781 break;
782 case E_INVALIDARG:
783 /* One or more arguments are invalid. */
784 break;
785 case E_POINTER:
786 /*Invalid pointer. */
787 break;
788 case E_HANDLE:
789 /*Invalid handle. */
790 break;
791 case E_FAIL:
792 /*Unspecified error. */
793 break;
794 default:
795 break;
796 }
797 return FALSE;
798 }
799#endif
800 return TRUE;
801}
802
803static void ChooseFavorite(LPCWSTR pszFavorite)
804{
805 HKEY hKey = NULL;
806 WCHAR szFavoritePath[512];
807 DWORD cbData, dwType;
808
810 goto done;
811
812 cbData = sizeof(szFavoritePath);
813 memset(szFavoritePath, 0, sizeof(szFavoritePath));
814 if (RegQueryValueExW(hKey, pszFavorite, NULL, &dwType, (LPBYTE) szFavoritePath, &cbData) != ERROR_SUCCESS)
815 goto done;
816
817 if (dwType == REG_SZ)
818 SelectNode(g_pChildWnd->hTreeWnd, szFavoritePath);
819
820done:
821 if (hKey)
823}
824
826{
827 HKEY hRoot;
828 WCHAR rootname[MAX_PATH], *buffer;
829 SIZE_T rootlen, subkeylen;
830 LPCWSTR subkey = GetItemPath(g_pChildWnd->hTreeWnd, hTI, &hRoot);
831 if (!subkey || !hRoot)
832 return NULL;
833 if (!GetKeyName(rootname, ARRAY_SIZE(rootname), hRoot, L""))
834 return NULL;
835 rootlen = lstrlenW(rootname) + 1; // + 1 for '\\'
836 subkeylen = lstrlenW(subkey);
837 buffer = (WCHAR*)malloc((rootlen + subkeylen + 1) * sizeof(WCHAR));
838 if (buffer)
839 {
840 lstrcpyW(buffer, rootname);
841 buffer[rootlen - 1] = '\\';
842 lstrcpyW(buffer + rootlen, subkey);
843 }
844 return buffer;
845}
846
848{
851 switch (uMsg)
852 {
853 case WM_INITDIALOG:
854 {
855 TVITEM tvi;
856 tvi.mask = TVIF_HANDLE | TVIF_TEXT;
858 tvi.pszText = name;
859 tvi.cchTextMax = _countof(name);
861 tvi.pszText[0] = UNICODE_NULL;
862 SetWindowTextW(hName, tvi.pszText);
863 SendMessageW(hName, EM_LIMITTEXT, _countof(name) - 1, 0);
864 return TRUE;
865 }
866 case WM_COMMAND:
867 switch (LOWORD(wParam))
868 {
869 case IDOK:
870 {
871 LPWSTR path;
872 HKEY hKey;
873 DWORD err;
874 if (!GetWindowTextW(hName, name, _countof(name)))
875 {
876 err = GetLastError();
877 goto failed;
878 }
880 if (!path)
881 {
883 goto failed;
884 }
887 if (err)
888 goto failed;
889 err = RegSetValueExW(hKey, name, 0, REG_SZ, (BYTE*)path, (lstrlenW(path) + 1) * sizeof(WCHAR));
891 if (err) failed:
892 ErrorBox(hWnd, err);
893 free(path);
894 return EndDialog(hWnd, err);
895 }
896 case IDCANCEL:
898 case IDC_FAVORITENAME:
899 if (HIWORD(wParam) == EN_UPDATE)
901 break;
902 }
903 break;
904 }
905 return FALSE;
906}
907
909{
910 BOOL bClipboardOpened = FALSE;
911 BOOL bSuccess = FALSE;
912 WCHAR szBuffer[512];
913 HGLOBAL hGlobal;
914 LPWSTR s;
915 SIZE_T cbGlobal;
916
917 if (!OpenClipboard(hWnd))
918 goto done;
919 bClipboardOpened = TRUE;
920
921 if (!EmptyClipboard())
922 goto done;
923
924 if (!GetKeyName(szBuffer, ARRAY_SIZE(szBuffer), hRootKey, keyName))
925 goto done;
926
927 cbGlobal = (wcslen(szBuffer) + 1) * sizeof(WCHAR);
928 hGlobal = GlobalAlloc(GMEM_MOVEABLE, cbGlobal);
929 if (!hGlobal)
930 goto done;
931
932 s = GlobalLock(hGlobal);
933 StringCbCopyW(s, cbGlobal, szBuffer);
934 GlobalUnlock(hGlobal);
935
937 bSuccess = TRUE;
938
939done:
940 if (bClipboardOpened)
942 return bSuccess;
943}
944
945static BOOL CreateNewValue(HKEY hRootKey, LPCWSTR pszKeyPath, DWORD dwType)
946{
947 WCHAR szNewValueFormat[128];
948 WCHAR szNewValue[128];
949 int iIndex = 1;
950 BYTE data[128];
951 DWORD dwExistingType, cbData;
952 LONG lResult;
953 HKEY hKey;
954 LVFINDINFO lvfi;
955
956 if (RegOpenKeyExW(hRootKey, pszKeyPath, 0, KEY_QUERY_VALUE | KEY_SET_VALUE,
957 &hKey) != ERROR_SUCCESS)
958 return FALSE;
959
960 LoadStringW(hInst, IDS_NEW_VALUE, szNewValueFormat, ARRAY_SIZE(szNewValueFormat));
961
962 do
963 {
964 wsprintf(szNewValue, szNewValueFormat, iIndex++);
965 cbData = sizeof(data);
966 lResult = RegQueryValueExW(hKey, szNewValue, NULL, &dwExistingType, data, &cbData);
967 }
968 while(lResult == ERROR_SUCCESS);
969
970 switch(dwType)
971 {
972 case REG_DWORD:
973 cbData = sizeof(DWORD);
974 break;
975 case REG_SZ:
976 case REG_EXPAND_SZ:
977 cbData = sizeof(WCHAR);
978 break;
979 case REG_MULTI_SZ:
980 /*
981 * WARNING: An empty multi-string has only one null char.
982 * Indeed, multi-strings are built in the following form:
983 * str1\0str2\0...strN\0\0
984 * where each strI\0 is a null-terminated string, and it
985 * ends with a terminating empty string.
986 * Therefore an empty multi-string contains only the terminating
987 * empty string, that is, one null char.
988 */
989 cbData = sizeof(WCHAR);
990 break;
991 case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
992 cbData = sizeof(DWORDLONG); // == sizeof(DWORD) * 2;
993 break;
994 default:
995 cbData = 0;
996 break;
997 }
998 memset(data, 0, cbData);
999 lResult = RegSetValueExW(hKey, szNewValue, 0, dwType, data, cbData);
1001 if (lResult != ERROR_SUCCESS)
1002 {
1003 return FALSE;
1004 }
1005
1006 RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath, TRUE);
1007
1008 /* locate the newly added value, and get ready to rename it */
1009 memset(&lvfi, 0, sizeof(lvfi));
1010 lvfi.flags = LVFI_STRING;
1011 lvfi.psz = szNewValue;
1012 iIndex = ListView_FindItem(g_pChildWnd->hListWnd, -1, &lvfi);
1013 if (iIndex >= 0)
1014 {
1019 }
1020
1021 return TRUE;
1022}
1023
1024static HRESULT
1025InitializeRemoteRegistryPicker(OUT IDsObjectPicker **pDsObjectPicker)
1026{
1027 HRESULT hRet;
1028
1029 *pDsObjectPicker = NULL;
1030
1031 hRet = CoCreateInstance(&CLSID_DsObjectPicker,
1032 NULL,
1033 CLSCTX_INPROC_SERVER,
1034 &IID_IDsObjectPicker,
1035 (LPVOID*)pDsObjectPicker);
1036 if (SUCCEEDED(hRet))
1037 {
1038 DSOP_INIT_INFO InitInfo;
1039 static DSOP_SCOPE_INIT_INFO Scopes[] =
1040 {
1041 {
1042 sizeof(DSOP_SCOPE_INIT_INFO),
1047 0,
1048 {
1049 {
1051 0,
1052 0
1053 },
1055 },
1056 NULL,
1057 NULL,
1058 S_OK
1059 },
1060 };
1061
1062 InitInfo.cbSize = sizeof(InitInfo);
1063 InitInfo.pwzTargetComputer = NULL;
1064 InitInfo.cDsScopeInfos = ARRAY_SIZE(Scopes);
1065 InitInfo.aDsScopeInfos = Scopes;
1066 InitInfo.flOptions = 0;
1067 InitInfo.cAttributesToFetch = 0;
1068 InitInfo.apwzAttributeNames = NULL;
1069
1070 hRet = (*pDsObjectPicker)->lpVtbl->Initialize(*pDsObjectPicker,
1071 &InitInfo);
1072
1073 if (FAILED(hRet))
1074 {
1075 /* delete the object picker in case initialization failed! */
1076 (*pDsObjectPicker)->lpVtbl->Release(*pDsObjectPicker);
1077 }
1078 }
1079
1080 return hRet;
1081}
1082
1083static HRESULT
1084InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
1087 IN UINT uSize)
1088{
1089 IDataObject *pdo = NULL;
1090 HRESULT hRet;
1091
1092 hRet = pDsObjectPicker->lpVtbl->InvokeDialog(pDsObjectPicker,
1093 hwndParent,
1094 &pdo);
1095 if (hRet == S_OK)
1096 {
1097 STGMEDIUM stm;
1098 FORMATETC fe;
1099
1100 fe.cfFormat = (CLIPFORMAT) RegisterClipboardFormatW(CFSTR_DSOP_DS_SELECTION_LIST);
1101 fe.ptd = NULL;
1102 fe.dwAspect = DVASPECT_CONTENT;
1103 fe.lindex = -1;
1104 fe.tymed = TYMED_HGLOBAL;
1105
1106 hRet = pdo->lpVtbl->GetData(pdo,
1107 &fe,
1108 &stm);
1109 if (SUCCEEDED(hRet))
1110 {
1111 PDS_SELECTION_LIST SelectionList = (PDS_SELECTION_LIST)GlobalLock(stm.hGlobal);
1112 if (SelectionList != NULL)
1113 {
1114 if (SelectionList->cItems == 1)
1115 {
1116 size_t nlen = wcslen(SelectionList->aDsSelection[0].pwzName);
1117 if (nlen >= uSize)
1118 {
1119 nlen = uSize - 1;
1120 }
1121
1123 SelectionList->aDsSelection[0].pwzName,
1124 nlen * sizeof(WCHAR));
1125
1126 lpBuffer[nlen] = L'\0';
1127 }
1128
1129 GlobalUnlock(stm.hGlobal);
1130 }
1131
1132 ReleaseStgMedium(&stm);
1133 }
1134
1135 pdo->lpVtbl->Release(pdo);
1136 }
1137
1138 return hRet;
1139}
1140
1141static VOID
1142FreeObjectPicker(IN IDsObjectPicker *pDsObjectPicker)
1143{
1144 pDsObjectPicker->lpVtbl->Release(pDsObjectPicker);
1145}
1146
1151{
1152 HKEY hKeyRoot = 0, hKey = 0;
1153 LPCWSTR keyPath;
1154 LPCWSTR valueName;
1155 BOOL result = TRUE;
1156 REGSAM regsam = KEY_READ;
1157 int item;
1158
1161
1162 switch (LOWORD(wParam))
1163 {
1165 LoadHive(hWnd);
1166 return TRUE;
1169 return TRUE;
1172 return TRUE;
1175 return TRUE;
1177 {
1178 IDsObjectPicker *ObjectPicker;
1179 WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1180 HRESULT hRet;
1181
1182 hRet = CoInitialize(NULL);
1183 if (SUCCEEDED(hRet))
1184 {
1185 hRet = InitializeRemoteRegistryPicker(&ObjectPicker);
1186 if (SUCCEEDED(hRet))
1187 {
1188 hRet = InvokeRemoteRegistryPickerDialog(ObjectPicker,
1189 hWnd,
1190 szComputerName,
1191 ARRAY_SIZE(szComputerName));
1192 if (hRet == S_OK)
1193 {
1194 // FIXME - connect to the registry
1195 }
1196
1197 FreeObjectPicker(ObjectPicker);
1198 }
1199
1201 }
1202
1203 return TRUE;
1204 }
1206 return TRUE;
1207 case ID_REGISTRY_PRINT:
1209 return TRUE;
1210 case ID_REGISTRY_EXIT:
1212 return TRUE;
1213 case ID_VIEW_STATUSBAR:
1215 return TRUE;
1218 return TRUE;
1219 case ID_HELP_HELPTOPICS:
1220 WinHelpW(hWnd, L"regedit", HELP_FINDER, 0);
1221 return TRUE;
1222 case ID_HELP_ABOUT:
1224 return TRUE;
1225 case ID_VIEW_SPLIT:
1226 {
1227 RECT rt;
1228 POINT pt, pts;
1230 pt.x = rt.left + g_pChildWnd->nSplitPos;
1231 pt.y = (rt.bottom / 2);
1232 pts = pt;
1233 if(ClientToScreen(g_pChildWnd->hWnd, &pts))
1234 {
1235 SetCursorPos(pts.x, pts.y);
1238 }
1239 return TRUE;
1240 }
1241 case ID_EDIT_RENAME:
1242 case ID_EDIT_MODIFY:
1243 case ID_EDIT_MODIFY_BIN:
1244 case ID_EDIT_DELETE:
1245 regsam |= KEY_WRITE;
1246 break;
1247 }
1248
1249 keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
1250 valueName = GetValueName(g_pChildWnd->hListWnd, -1);
1251 if (keyPath)
1252 {
1253 if (RegOpenKeyExW(hKeyRoot, keyPath, 0, regsam, &hKey) != ERROR_SUCCESS)
1254 hKey = 0;
1255 }
1256
1257 switch (LOWORD(wParam))
1258 {
1259 case ID_EDIT_MODIFY:
1260 if (valueName && ModifyValue(hWnd, hKey, valueName, FALSE))
1261 RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath, FALSE);
1262 break;
1263 case ID_EDIT_MODIFY_BIN:
1264 if (valueName && ModifyValue(hWnd, hKey, valueName, TRUE))
1265 RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath, FALSE);
1266 break;
1267 case ID_EDIT_RENAME:
1268 if (GetFocus() == g_pChildWnd->hListWnd)
1269 {
1271 {
1273 if(item > -1)
1274 {
1276 }
1277 }
1278 }
1279 else if (GetFocus() == g_pChildWnd->hTreeWnd)
1280 {
1281 /* Get focused entry of treeview (if any) */
1283 if (hItem != NULL)
1285 }
1286 break;
1287 case ID_EDIT_DELETE:
1288 {
1289 if (GetFocus() == g_pChildWnd->hListWnd && hKey)
1290 {
1292 if(nSelected >= 1)
1293 {
1294 WCHAR msg[128], caption[128];
1298 {
1299 int ni, errs;
1300
1301 item = -1;
1302 errs = 0;
1304 {
1305 valueName = GetValueName(g_pChildWnd->hListWnd, item);
1306 if(RegDeleteValueW(hKey, valueName) != ERROR_SUCCESS)
1307 {
1308 errs++;
1309 }
1310 item = ni;
1311 }
1312
1313 RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath, FALSE);
1314 if(errs > 0)
1315 {
1319 }
1320 }
1321 }
1322 }
1323 else if (GetFocus() == g_pChildWnd->hTreeWnd)
1324 {
1325 if (keyPath == NULL || *keyPath == UNICODE_NULL)
1326 {
1328 }
1329 else if (DeleteKey(hWnd, hKeyRoot, keyPath))
1330 {
1333 }
1334 }
1335 break;
1336 }
1338 CreateNewValue(hKeyRoot, keyPath, REG_SZ);
1339 break;
1341 CreateNewValue(hKeyRoot, keyPath, REG_BINARY);
1342 break;
1344 CreateNewValue(hKeyRoot, keyPath, REG_DWORD);
1345 break;
1347 CreateNewValue(hKeyRoot, keyPath, REG_MULTI_SZ);
1348 break;
1350 CreateNewValue(hKeyRoot, keyPath, REG_EXPAND_SZ);
1351 break;
1352 case ID_EDIT_FIND:
1354 break;
1355 case ID_EDIT_FINDNEXT:
1357 break;
1359 CopyKeyName(hWnd, hKeyRoot, keyPath);
1360 break;
1362 RegKeyEditPermissions(hWnd, hKeyRoot, NULL, keyPath);
1363 break;
1364 case ID_VIEW_REFRESH:
1366 keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
1367 RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath, TRUE);
1368 break;
1369 //case ID_OPTIONS_TOOLBAR:
1370 // toggle_child(hWnd, LOWORD(wParam), hToolBar);
1371 // break;
1372 case ID_EDIT_NEW_KEY:
1374 break;
1377 break;
1380 break;
1381 case ID_TREE_RENAME:
1384 break;
1385 case ID_TREE_DELETE:
1387 if (keyPath == 0 || *keyPath == 0)
1389 else if (DeleteKey(hWnd, hKeyRoot, keyPath))
1391 break;
1392 case ID_TREE_EXPORT:
1394 break;
1397 RegKeyEditPermissions(hWnd, hKeyRoot, NULL, keyPath);
1398 break;
1399 case ID_SWITCH_PANELS:
1400 {
1401 BOOL bShiftDown = GetKeyState(VK_SHIFT) < 0;
1402 HWND hwndItem = GetNextDlgTabItem(g_pChildWnd->hWnd, GetFocus(), bShiftDown);
1403 if (hwndItem == g_pChildWnd->hAddressBarWnd)
1404 PostMessageW(hwndItem, EM_SETSEL, 0, -1);
1405 SetFocus(hwndItem);
1406 }
1407 break;
1408 case ID_ADDRESS_FOCUS:
1411 break;
1412 default:
1414 {
1415 HMENU hMenu;
1416 MENUITEMINFOW mii;
1417 WCHAR szFavorite[512];
1418
1420
1421 memset(&mii, 0, sizeof(mii));
1422 mii.cbSize = sizeof(mii);
1423 mii.fMask = MIIM_TYPE;
1424 mii.fType = MFT_STRING;
1425 mii.dwTypeData = szFavorite;
1426 mii.cch = ARRAY_SIZE(szFavorite);
1427
1428 if (GetMenuItemInfo(hMenu, LOWORD(wParam) - ID_FAVORITES_MIN, TRUE, &mii))
1429 {
1430 ChooseFavorite(szFavorite);
1431 }
1432 }
1434 {
1435 WORD wID = LOWORD(wParam);
1437 while(wID > ID_TREE_SUGGESTION_MIN)
1438 {
1439 if (*s)
1440 s += wcslen(s) + 1;
1441 wID--;
1442 }
1444 }
1445 else
1446 {
1447 result = FALSE;
1448 }
1449 break;
1450 }
1451
1452 if(hKey)
1454 return result;
1455}
1456
1464{
1465 RECT rc;
1466 switch (message)
1467 {
1468 case WM_CREATE:
1469 // For now, the Help dialog item is disabled because of lacking of HTML Help support
1471 GetClientRect(hWnd, &rc);
1474 rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
1475 hWnd, (HMENU)0, hInst, 0);
1476 break;
1477 case WM_COMMAND:
1480 break;
1481 case WM_ACTIVATE:
1484 break;
1485 case WM_SIZE:
1487 break;
1488 case WM_INITMENU:
1490 break;
1491 case WM_ENTERMENULOOP:
1493 break;
1494 case WM_EXITMENULOOP:
1496 break;
1497 case WM_MENUSELECT:
1499 break;
1500 case WM_SYSCOLORCHANGE:
1501 /* Forward WM_SYSCOLORCHANGE to common controls */
1504 break;
1505 case WM_DESTROY:
1506 WinHelpW(hWnd, L"regedit", HELP_QUIT, 0);
1507 SaveSettings();
1508 PostQuitMessage(0);
1509 default:
1511 }
1512 return 0;
1513}
#define SE_BACKUP_NAME
#define SE_RESTORE_NAME
#define msg(x)
Definition: auth_time.c:54
void SaveSettings(void)
Definition: settings.c:115
HWND hWnd
Definition: settings.c:17
static __inline VOID DeleteNode(NODE *node)
Definition: text.h:48
#define IDS_APP_TITLE
Definition: resource.h:10
#define CF_UNICODETEXT
Definition: constants.h:408
void ShowAboutBox(HWND hWnd)
Definition: about.c:12
ChildWnd * g_pChildWnd
Definition: childwnd.c:13
LPCWSTR get_root_key_name(HKEY hRootKey)
Definition: childwnd.c:76
BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCWSTR valueName, BOOL EditBin)
Definition: edit.c:1522
BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath)
Definition: edit.c:1938
BOOL GetKeyName(LPWSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCWSTR lpSubKey)
Definition: edit.c:2072
int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMessage,...)
Definition: error.c:38
int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode,...)
Definition: error.c:11
void FindNextMessageBox(HWND hWnd)
Definition: find.c:799
void FindDialog(HWND hWnd)
Definition: find.c:811
static HRESULT InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker, IN HWND hwndParent OPTIONAL, OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: framewnd.c:1084
BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCWSTR keyName)
Definition: framewnd.c:908
struct FILTERPAIR * PFILTERPAIR
void SetupStatusBar(HWND hWnd, BOOL bResize)
Definition: framewnd.c:153
static BOOL CheckCommDlgError(HWND hWnd)
Definition: framewnd.c:206
static void resize_frame_client(HWND hWnd)
Definition: framewnd.c:42
static BOOL UnloadHive(HWND hWnd)
Definition: framewnd.c:430
static void OnEnterMenuLoop(HWND hWnd)
Definition: framewnd.c:109
static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME *pofn, BOOL bSave)
Definition: framewnd.c:272
BOOL PrintRegistryHive(HWND hWnd, LPWSTR path)
Definition: framewnd.c:731
static HRESULT InitializeRemoteRegistryPicker(OUT IDsObjectPicker **pDsObjectPicker)
Definition: framewnd.c:1025
static INT_PTR CALLBACK LoadHive_KeyNameInHookProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: framewnd.c:319
#define LOADHIVE_KEYNAMELENGTH
Definition: framewnd.c:317
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, LPCWSTR lpszSystemName, BOOL bEnablePrivilege)
Definition: framewnd.c:343
static INT_PTR CALLBACK AddToFavoritesDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: framewnd.c:847
#define FAVORITES_MENU_POSITION
Definition: framewnd.c:14
static void ChooseFavorite(LPCWSTR pszFavorite)
Definition: framewnd.c:803
static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
Definition: framewnd.c:129
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: framewnd.c:1150
static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
Definition: framewnd.c:196
BOOL ExportRegistryFile(HWND hWnd)
Definition: framewnd.c:608
void UpdateStatusBar(void)
Definition: framewnd.c:165
static VOID FreeObjectPicker(IN IDsObjectPicker *pDsObjectPicker)
Definition: framewnd.c:1142
WCHAR Suggestions[256]
Definition: childwnd.c:17
static BOOL LoadHive(HWND hWnd)
Definition: framewnd.c:373
void BuildFilterStrings(WCHAR *Filter, PFILTERPAIR Pairs, int PairCount)
Definition: framewnd.c:257
static BOOL CreateNewValue(HKEY hRootKey, LPCWSTR pszKeyPath, DWORD dwType)
Definition: framewnd.c:945
static WCHAR s_szFavoritesRegKey[]
Definition: framewnd.c:15
static void OnExitMenuLoop(HWND hWnd)
Definition: framewnd.c:121
static UINT ErrorBox(HWND hWnd, UINT Error)
Definition: framewnd.c:19
static BOOL ImportRegistryFile(HWND hWnd)
Definition: framewnd.c:462
static BOOL bInMenuLoop
Definition: framewnd.c:16
static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: framewnd.c:554
static LPWSTR GetItemFullPath(HTREEITEM hTI)
Definition: framewnd.c:825
WCHAR FileNameBuffer[MAX_PATH]
Definition: framewnd.c:248
static void OnInitMenu(HWND hWnd)
Definition: framewnd.c:50
static void resize_frame_rect(HWND hWnd, PRECT prect)
Definition: framewnd.c:29
LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: framewnd.c:1463
BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath, BOOL bSelectNone)
Definition: listview.c:657
WCHAR * GetValueName(HWND hwndLV, int iStartAt)
Definition: listview.c:42
HMENU hMenuFrame
Definition: main.c:24
WCHAR szChildClass[MAX_LOADSTRING]
Definition: main.c:32
HWND hStatusBar
Definition: main.c:23
BOOL import_registry_file(FILE *reg_file)
Definition: regproc.c:1041
BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
Definition: treeview.c:774
#define ARRAY_SIZE(A)
Definition: main.h:20
#define REG_FORMAT_5
Definition: main.h:31
#define REG_FORMAT_4
Definition: main.h:32
LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY *phRootKey)
Definition: treeview.c:73
BOOL RegKeyEditPermissions(HWND hWndOwner, HKEY hKey, LPCWSTR lpMachine, LPCWSTR lpKeyName)
Definition: security.c:793
BOOL RefreshTreeView(HWND hWndTV)
Definition: treeview.c:303
BOOL export_registry_key(WCHAR *file_name, WCHAR *path, DWORD format)
Definition: regproc.c:1566
BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem)
Definition: treeview.c:563
BOOL txt_export_registry_key(LPCWSTR file_name, LPCWSTR path)
Definition: txtproc.c:401
#define ID_TREE_SUGGESTION_MIN
Definition: resource.h:109
#define ID_REGISTRY_EXPORTREGISTRYFILE
Definition: resource.h:55
#define IDS_QUERY_IMPORT_HIVE_MSG
Definition: resource.h:94
#define IDS_UNLOAD_HIVE
Definition: resource.h:97
#define ID_EDIT_COPYKEYNAME
Definition: resource.h:45
#define IDS_EXPORT_REG_FILE
Definition: resource.h:84
#define IDD_LOADHIVE
Definition: resource.h:242
#define IDS_FLT_ALLFILES_FLT
Definition: resource.h:123
#define IDS_FLT_REGEDIT4
Definition: resource.h:120
#define IDS_ERR_DELETEVALUE
Definition: resource.h:90
#define IDC_EXPORT_ALL
Definition: resource.h:238
#define IDS_FLT_REGEDIT4_FLT
Definition: resource.h:121
#define IDS_FLT_HIVFILES_FLT
Definition: resource.h:119
#define ID_EDIT_MODIFY
Definition: resource.h:48
#define IDC_FAVORITENAME
Definition: resource.h:245
#define ID_VIEW_STATUSBAR
Definition: resource.h:40
#define IDS_FLT_ALLFILES
Definition: resource.h:122
#define IDS_IMPORT_OK
Definition: resource.h:150
#define IDC_EDIT_KEY
Definition: resource.h:243
#define ID_REGISTRY_UNLOADHIVE
Definition: resource.h:65
#define IDS_IMPORT_REG_FILE
Definition: resource.h:83
#define ID_FAVOURITES_ADDTOFAVOURITES
Definition: resource.h:38
#define ID_REGISTRY_PRINT
Definition: resource.h:58
#define ID_TREE_PERMISSIONS
Definition: resource.h:112
#define ID_EDIT_DELETE
Definition: resource.h:43
#define IDS_QUERY_DELETE_CONFIRM
Definition: resource.h:88
#define IDS_QUERY_IMPORT_HIVE_CAPTION
Definition: resource.h:93
#define ID_TREE_EXPANDBRANCH
Definition: resource.h:62
#define IDC_EXPORT_BRANCH
Definition: resource.h:239
#define ID_VIEW_REFRESH
Definition: resource.h:42
#define IDD_ADDFAVORITES
Definition: resource.h:33
#define ID_TREE_COLLAPSEBRANCH
Definition: resource.h:63
#define IDC_EXPORT_BRANCH_TEXT
Definition: resource.h:240
#define ID_EDIT_NEW_MULTISTRINGVALUE
Definition: resource.h:99
#define ID_VIEW_SPLIT
Definition: resource.h:41
#define ID_REGISTRY_CONNECTNETWORKREGISTRY
Definition: resource.h:56
#define ID_EDIT_NEW_STRINGVALUE
Definition: resource.h:50
#define IDS_EXPORT_ERROR
Definition: resource.h:152
#define IDS_FLT_REGFILES
Definition: resource.h:116
#define IDS_NEW_VALUE
Definition: resource.h:146
#define IDS_ERR_DELVAL_CAPTION
Definition: resource.h:89
#define ID_REGISTRY_DISCONNECTNETWORKREGISTRY
Definition: resource.h:57
#define IDS_LOAD_HIVE
Definition: resource.h:96
#define ID_ADDRESS_FOCUS
Definition: resource.h:113
#define IDS_FLT_REGFILES_FLT
Definition: resource.h:117
#define IDS_QUERY_DELETE_ONE
Definition: resource.h:86
#define ID_HELP_HELPTOPICS
Definition: resource.h:60
#define IDS_FLT_TXTFILES
Definition: resource.h:124
#define ID_EDIT_MODIFY_BIN
Definition: resource.h:75
#define ID_EDIT_NEW_EXPANDABLESTRINGVALUE
Definition: resource.h:100
#define IDS_FLT_HIVFILES
Definition: resource.h:118
#define ID_SWITCH_PANELS
Definition: resource.h:102
#define ID_EDIT_NEW_KEY
Definition: resource.h:49
#define ID_TREE_SUGGESTION_MAX
Definition: resource.h:110
#define ID_EDIT_RENAME
Definition: resource.h:44
#define ID_TREE_EXPORT
Definition: resource.h:111
#define IDD_EXPORTRANGE
Definition: resource.h:29
#define ID_FAVORITES_MAX
Definition: resource.h:317
#define ID_EDIT_FINDNEXT
Definition: resource.h:47
#define ID_EDIT_NEW_DWORDVALUE
Definition: resource.h:52
#define ID_VIEW_MENU
Definition: resource.h:12
#define ID_REGISTRY_LOADHIVE
Definition: resource.h:64
#define ID_FAVORITES_MIN
Definition: resource.h:316
#define ID_HELP_ABOUT
Definition: resource.h:61
#define ID_REGISTRY_EXIT
Definition: resource.h:37
#define ID_TREE_RENAME
Definition: resource.h:105
#define IDS_IMPORT_ERROR
Definition: resource.h:151
#define ID_TREE_DELETE
Definition: resource.h:104
#define ID_EDIT_PERMISSIONS
Definition: resource.h:103
#define IDS_FLT_TXTFILES_FLT
Definition: resource.h:125
#define IDS_QUERY_DELETE_MORE
Definition: resource.h:87
#define ID_EDIT_NEW_BINARYVALUE
Definition: resource.h:51
#define ID_EDIT_FIND
Definition: resource.h:46
#define ID_REGISTRY_IMPORTREGISTRYFILE
Definition: resource.h:54
BOOL Error
Definition: chkdsk.c:66
#define RegCloseKey(hKey)
Definition: registry.h:49
#define CDERR_MEMLOCKFAILURE
Definition: cderr.h:15
#define FNERR_SUBCLASSFAILURE
Definition: cderr.h:35
#define CDERR_MEMALLOCFAILURE
Definition: cderr.h:14
#define FNERR_BUFFERTOOSMALL
Definition: cderr.h:37
#define CDERR_NOHINSTANCE
Definition: cderr.h:9
#define CDERR_LOADSTRFAILURE
Definition: cderr.h:10
#define CDERR_NOHOOK
Definition: cderr.h:16
#define FNERR_INVALIDFILENAME
Definition: cderr.h:36
#define CDERR_INITIALIZATION
Definition: cderr.h:7
#define CDERR_LOADRESFAILURE
Definition: cderr.h:12
#define CDERR_NOTEMPLATE
Definition: cderr.h:8
#define CDERR_FINDRESFAILURE
Definition: cderr.h:11
#define CDERR_LOCKRESFAILURE
Definition: cderr.h:13
#define CDERR_DIALOGFAILURE
Definition: cderr.h:4
#define CDERR_STRUCTSIZE
Definition: cderr.h:6
DWORD WINAPI CommDlgExtendedError(void)
Definition: cdlg32.c:148
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
#define GetSaveFileName
Definition: commdlg.h:666
#define OFN_EXPLORER
Definition: commdlg.h:104
#define PD_USEDEVMODECOPIESANDCOLLATE
Definition: commdlg.h:166
#define PD_RESULT_CANCEL
Definition: commdlg.h:201
#define PrintDlg
Definition: commdlg.h:668
#define PD_RETURNDC
Definition: commdlg.h:155
#define OFN_ENABLEHOOK
Definition: commdlg.h:99
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_ENABLESIZING
Definition: commdlg.h:101
#define CDN_FILEOK
Definition: commdlg.h:38
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define PD_RESULT_PRINT
Definition: commdlg.h:202
#define OFN_ENABLETEMPLATE
Definition: commdlg.h:102
#define PD_RESULT_APPLY
Definition: commdlg.h:203
#define OFN_PATHMUSTEXIST
Definition: commdlg.h:117
PRINTDLGA PRINTDLG
Definition: commdlg.h:660
#define GetOpenFileName
Definition: commdlg.h:665
OPENFILENAMEA OPENFILENAME
Definition: commdlg.h:657
static HWND hwndParent
Definition: cryptui.c:300
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
#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 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 RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegUnLoadKeyW(HKEY hKey, LPCWSTR lpSubKey)
Definition: reg.c:5078
LONG WINAPI RegFlushKey(HKEY hKey)
Definition: reg.c:2951
LONG WINAPI RegLoadKeyW(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpFile)
Definition: reg.c:3079
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
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:2830
LONG WINAPI RegSaveKeyW(HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: reg.c:4617
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:374
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetCurrentProcess()
Definition: compat.h:759
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
#define pt(x, y)
Definition: drawing.c:79
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2996
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
FxAutoRegKey hKey
static struct netconfig_info ni
Definition: getnetconfig.c:158
GLdouble s
Definition: gl.h:2039
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
GLuint64EXT * result
Definition: glext.h:11304
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
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
ULONG Release()
nsrefcnt Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
unsigned long long DWORDLONG
Definition: intsafe.h:93
#define FAILED(hr)
Definition: intsafe.h:51
#define c
Definition: ke_i.h:80
#define REG_SZ
Definition: layer.c:22
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define _MAX_PATH
Definition: utility.h:77
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
static HTREEITEM hRoot
Definition: treeview.c:383
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static ATOM item
Definition: dde.c:856
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define KEY_WRITE
Definition: nt_native.h:1031
#define DWORD
Definition: nt_native.h:44
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define UNICODE_NULL
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
#define L(x)
Definition: ntvdm.h:50
#define DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN
Definition: objsel.h:127
#define DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN
Definition: objsel.h:123
#define DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE
Definition: objsel.h:130
struct _DS_SELECTION_LIST * PDS_SELECTION_LIST
#define DSOP_SCOPE_TYPE_GLOBAL_CATALOG
Definition: objsel.h:125
#define DSOP_DOWNLEVEL_FILTER_COMPUTERS
Definition: objsel.h:54
#define DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE
Definition: objsel.h:129
#define DSOP_SCOPE_TYPE_WORKGROUP
Definition: objsel.h:128
#define DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN
Definition: objsel.h:126
#define DSOP_FILTER_COMPUTERS
Definition: objsel.h:41
#define DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN
Definition: objsel.h:122
struct _DSOP_SCOPE_INIT_INFO DSOP_SCOPE_INIT_INFO
#define CFSTR_DSOP_DS_SELECTION_LIST
Definition: objsel.h:27
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define TVITEM
Definition: commctrl.h:3370
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2678
#define LVFINDINFO
Definition: commctrl.h:2468
#define LVFI_STRING
Definition: commctrl.h:2442
#define TVIF_TEXT
Definition: commctrl.h:3271
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3425
#define ListView_EditLabel(hwndLV, i)
Definition: commctrl.h:2545
#define LVNI_SELECTED
Definition: commctrl.h:2429
#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 TVE_EXPAND
Definition: commctrl.h:3428
#define LVIS_SELECTED
Definition: commctrl.h:2324
#define ListView_GetSelectedCount(hwndLV)
Definition: commctrl.h:2714
#define TVIF_HANDLE
Definition: commctrl.h:3275
#define TVE_COLLAPSE
Definition: commctrl.h:3427
#define TreeView_EditLabel(hwnd, hitem)
Definition: commctrl.h:3509
#define SB_SETPARTS
Definition: commctrl.h:1959
#define SB_SETTEXTW
Definition: commctrl.h:1947
#define LVIS_FOCUSED
Definition: commctrl.h:2323
#define ListView_FindItem(hwnd, iStart, plvfi)
Definition: commctrl.h:2475
#define ListView_EnsureVisible(hwndLV, i, fPartialOK)
Definition: commctrl.h:2524
#define err(...)
#define WM_NOTIFY
Definition: richedit.h:61
const WCHAR * str
#define REG_QWORD
Definition: sdbapi.c:597
#define REG_DWORD
Definition: sdbapi.c:596
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define memset(x, y, z)
Definition: compat.h:39
OPENFILENAME ofn
Definition: sndrec32.cpp:56
#define _countof(array)
Definition: sndvol32.h:70
& rect
Definition: startmenu.cpp:1413
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
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
int nSplitPos
Definition: main.h:56
HWND hTreeWnd
Definition: main.h:50
HWND hListWnd
Definition: main.h:51
HWND hAddressBarWnd
Definition: main.h:52
HWND hWnd
Definition: main.h:49
UINT FilterID
Definition: framewnd.c:253
UINT DisplayID
Definition: framewnd.c:252
ULONG cAttributesToFetch
Definition: objsel.h:114
ULONG cbSize
Definition: objsel.h:109
PCWSTR * apwzAttributeNames
Definition: objsel.h:115
PDSOP_SCOPE_INIT_INFO aDsScopeInfos
Definition: objsel.h:112
ULONG cDsScopeInfos
Definition: objsel.h:111
PCWSTR pwzTargetComputer
Definition: objsel.h:110
ULONG flOptions
Definition: objsel.h:113
DS_SELECTION aDsSelection[ANYSIZE_ARRAY]
Definition: objsel.h:146
PWSTR pwzName
Definition: objsel.h:134
LPOPENFILENAMEA lpOFN
Definition: commdlg.h:407
Definition: ftp_var.h:139
Definition: inflate.c:139
Definition: tftpd.h:60
Definition: name.c:39
LPWSTR dwTypeData
Definition: winuser.h:3280
LPARAM lCustData
Definition: commdlg.h:346
LPCSTR lpstrDefExt
Definition: commdlg.h:345
LPCSTR lpTemplateName
Definition: commdlg.h:348
DWORD nFilterIndex
Definition: commdlg.h:335
HWND hwndOwner
Definition: commdlg.h:330
LPCSTR lpstrTitle
Definition: commdlg.h:341
HINSTANCE hInstance
Definition: commdlg.h:331
WORD nFileExtension
Definition: commdlg.h:344
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
LPOFNHOOKPROC lpfnHook
Definition: commdlg.h:347
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
WORD nMaxPage
Definition: commdlg.h:474
HDC hDC
Definition: commdlg.h:469
DWORD Flags
Definition: commdlg.h:470
WORD nCopies
Definition: commdlg.h:475
WORD nFromPage
Definition: commdlg.h:471
HGLOBAL hDevMode
Definition: commdlg.h:467
WORD nToPage
Definition: commdlg.h:472
WORD nMinPage
Definition: commdlg.h:473
HGLOBAL hDevNames
Definition: commdlg.h:468
HWND hwndOwner
Definition: commdlg.h:466
DWORD lStructSize
Definition: commdlg.h:465
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
int32_t INT_PTR
Definition: typedefs.h:64
unsigned char * LPBYTE
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define IN
Definition: typedefs.h:39
#define HIWORD(l)
Definition: typedefs.h:247
#define OUT
Definition: typedefs.h:40
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1394
#define ZeroMemory
Definition: winbase.h:1743
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:446
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:449
#define GMEM_MOVEABLE
Definition: winbase.h:320
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:269
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define ERROR_NOT_ALL_ASSIGNED
Definition: winerror.h:782
#define E_HANDLE
Definition: winerror.h:2850
#define ERROR_CANCELLED
Definition: winerror.h:726
#define E_POINTER
Definition: winerror.h:2365
BOOL WINAPI DeleteDC(_In_ HDC)
#define HKEY_CURRENT_USER
Definition: winreg.h:11
ACCESS_MASK REGSAM
Definition: winreg.h:69
#define RegRestoreKey
Definition: winreg.h:526
HWND WINAPI GetFocus(void)
Definition: window.c:1875
#define SW_HIDE
Definition: winuser.h:779
#define MF_BYCOMMAND
Definition: winuser.h:202
#define EM_LIMITTEXT
Definition: winuser.h:2011
#define MAKELPARAM(l, h)
Definition: winuser.h:4019
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
#define HELP_QUIT
Definition: winuser.h:2425
#define IDCANCEL
Definition: winuser.h:842
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define AppendMenu
Definition: winuser.h:5751
#define MB_ICONHAND
Definition: winuser.h:799
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1619
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define EN_UPDATE
Definition: winuser.h:2039
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4410
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1622
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
#define WM_COMMAND
Definition: winuser.h:1751
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
#define MF_CHECKED
Definition: winuser.h:132
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_INITMENU
Definition: winuser.h:1756
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
#define WA_INACTIVE
Definition: winuser.h:2633
#define WM_INITDIALOG
Definition: winuser.h:1750
#define WM_LBUTTONDOWN
Definition: winuser.h:1787
#define MB_YESNO
Definition: winuser.h:828
BOOL WINAPI MessageBeep(_In_ UINT uType)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1637
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
Definition: cursoricon.c:3024
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2442
HWND WINAPI GetNextDlgTabItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MF_POPUP
Definition: winuser.h:136
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define BM_SETCHECK
Definition: winuser.h:1932
#define WM_ACTIVATE
Definition: winuser.h:1623
#define MB_ICONERROR
Definition: winuser.h:798
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define HELP_FINDER
Definition: winuser.h:2430
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_ENTERMENULOOP
Definition: winuser.h:1815
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define MF_ENABLED
Definition: winuser.h:128
#define MF_SEPARATOR
Definition: winuser.h:137
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)
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define WM_EXITMENULOOP
Definition: winuser.h:1816
#define EM_SETSEL
Definition: winuser.h:2029
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define MB_OK
Definition: winuser.h:801
#define wsprintf
Definition: winuser.h:5885
#define MB_ICONWARNING
Definition: winuser.h:797
#define MB_ICONQUESTION
Definition: winuser.h:800
#define MB_ICONINFORMATION
Definition: winuser.h:813
#define MB_ICONSTOP
Definition: winuser.h:814
#define VK_SHIFT
Definition: winuser.h:2213
#define MFT_STRING
Definition: winuser.h:757
#define SW_SHOW
Definition: winuser.h:786
#define WM_DESTROY
Definition: winuser.h:1620
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:846
#define IDC_SIZEWE
Definition: winuser.h:702
#define GetMenuItemInfo
Definition: winuser.h:5808
#define WM_MENUSELECT
Definition: winuser.h:1758
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MIIM_TYPE
Definition: winuser.h:736
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
HMENU WINAPI GetMenu(_In_ HWND)
SHORT WINAPI GetKeyState(_In_ int)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define BM_GETCHECK
Definition: winuser.h:1929
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define MF_GRAYED
Definition: winuser.h:129
#define REG_FORCE_RESTORE
Definition: cmtypes.h:109
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:930
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193