4 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 #define STATUS_WINDOW 2001
27 #define TREE_WINDOW 2002
28 #define LIST_WINDOW 2003
33 #define ARRAY_SIZE(A) (sizeof(A)/sizeof(*A))
35 #define PM_MODIFYVALUE 0
37 #define PM_TREECONTEXT 2
41 #define MAX_NEW_KEY_LEN 128
42 #define KEY_MAX_LEN 1024
44 #define REG_FORMAT_5 1
45 #define REG_FORMAT_4 2
47 /******************************************************************************/
51 OPTIONS_AUTO_REFRESH
= 0x01,
52 OPTIONS_READ_ONLY_MODE
= 0x02,
53 OPTIONS_CONFIRM_ON_DELETE
= 0x04,
54 OPTIONS_SAVE_ON_EXIT
= 0x08,
55 OPTIONS_DISPLAY_BINARY_DATA
= 0x10,
56 OPTIONS_VIEW_TREE_ONLY
= 0x20,
57 OPTIONS_VIEW_DATA_ONLY
= 0x40,
68 int nFocusPanel
; /* 0: left 1: right */
71 WCHAR szPath
[MAX_PATH
];
73 extern ChildWnd
* g_pChildWnd
;
75 /*******************************************************************************
78 extern HINSTANCE hInst
;
79 extern HWND hFrameWnd
;
80 extern HMENU hMenuFrame
;
81 extern HWND hStatusBar
;
82 extern HMENU hPopupMenus
;
84 extern enum OPTION_FLAGS Options
;
86 extern WCHAR szTitle
[];
87 extern WCHAR szFrameClass
[];
88 extern WCHAR szChildClass
[];
90 extern const WCHAR g_szGeneralRegKey
[];
91 extern const WCHAR
* reg_class_namesW
[];
94 void ShowAboutBox(HWND hWnd
);
97 LRESULT CALLBACK
ChildWndProc(HWND
, UINT
, WPARAM
, LPARAM
);
98 void ResizeWnd(int cx
, int cy
);
99 LPCWSTR
get_root_key_name(HKEY hRootKey
);
100 VOID
UpdateAddress(HTREEITEM hItem
, HKEY hRootKey
, LPCWSTR pszPath
);
103 BOOL
ModifyValue(HWND hwnd
, HKEY hKey
, LPCWSTR valueName
, BOOL EditBin
);
104 BOOL
DeleteKey(HWND hwnd
, HKEY hKeyRoot
, LPCWSTR keyPath
);
105 LONG
RenameKey(HKEY hKey
, LPCWSTR lpSubKey
, LPCWSTR lpNewName
);
106 LONG
RenameValue(HKEY hKey
, LPCWSTR lpSubKey
, LPCWSTR lpDestValue
, LPCWSTR lpSrcValue
);
107 LONG
QueryStringValue(HKEY hKey
, LPCWSTR lpSubKey
, LPCWSTR lpValueName
, LPWSTR pszBuffer
, DWORD dwBufferLen
);
108 BOOL
GetKeyName(LPWSTR pszDest
, size_t iDestLength
, HKEY hRootKey
, LPCWSTR lpSubKey
);
111 int ErrorMessageBox(HWND hWnd
, LPCWSTR lpTitle
, DWORD dwErrorCode
, ...);
112 int InfoMessageBox(HWND hWnd
, UINT uType
, LPCWSTR lpTitle
, LPCWSTR lpMessage
, ...);
115 void FindDialog(HWND hWnd
);
116 BOOL
FindNext(HWND hWnd
);
117 void FindNextMessageBox(HWND hWnd
);
120 LRESULT CALLBACK
FrameWndProc(HWND
, UINT
, WPARAM
, LPARAM
);
121 void SetupStatusBar(HWND hWnd
, BOOL bResize
);
122 void UpdateStatusBar(void);
123 BOOL
CopyKeyName(HWND hWnd
, HKEY hRootKey
, LPCWSTR keyName
);
124 BOOL
ExportRegistryFile(HWND hWnd
);
127 HWND
CreateListView(HWND hwndParent
, HMENU id
, INT cx
);
128 BOOL
RefreshListView(HWND hwndLV
, HKEY hKey
, LPCWSTR keyPath
);
129 WCHAR
*GetValueName(HWND hwndLV
, int iStartAt
);
130 BOOL
ListWndNotifyProc(HWND hWnd
, WPARAM wParam
, LPARAM lParam
, BOOL
*Result
);
131 BOOL
TreeWndNotifyProc(HWND hWnd
, WPARAM wParam
, LPARAM lParam
, BOOL
*Result
);
132 BOOL
IsDefaultValue(HWND hwndLV
, int i
);
135 void WINAPIV
output_message(unsigned int id
, ...);
136 void WINAPIV
error_exit(unsigned int id
, ...);
139 char *GetMultiByteString(const WCHAR
*strW
);
140 BOOL
import_registry_file(FILE *reg_file
);
141 void delete_registry_key(WCHAR
*reg_key_name
);
142 BOOL
export_registry_key(WCHAR
*file_name
, WCHAR
*path
, DWORD format
);
145 BOOL
RegKeyEditPermissions(HWND hWndOwner
, HKEY hKey
, LPCWSTR lpMachine
, LPCWSTR lpKeyName
);
148 void LoadSettings(void);
149 void SaveSettings(void);
152 HWND
CreateTreeView(HWND hwndParent
, LPWSTR pHostName
, HMENU id
);
153 BOOL
RefreshTreeView(HWND hWndTV
);
154 BOOL
RefreshTreeItem(HWND hwndTV
, HTREEITEM hItem
);
155 BOOL
OnTreeExpanding(HWND hWnd
, NMTREEVIEW
* pnmtv
);
156 LPCWSTR
GetItemPath(HWND hwndTV
, HTREEITEM hItem
, HKEY
* phRootKey
);
157 BOOL
DeleteNode(HWND hwndTV
, HTREEITEM hItem
);
158 HTREEITEM
InsertNode(HWND hwndTV
, HTREEITEM hItem
, LPWSTR name
);
159 HWND
StartKeyRename(HWND hwndTV
);
160 BOOL
CreateNewKey(HWND hwndTV
, HTREEITEM hItem
);
161 BOOL
SelectNode(HWND hwndTV
, LPCWSTR keyPath
);
162 void DestroyTreeView(HWND hwndTV
);
163 void DestroyListView(HWND hwndLV
);
164 void DestroyMainMenu(void);