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 St, Fifth Floor, Boston, MA 02110-1301, USA
27 #define STATUS_WINDOW 2001
28 #define TREE_WINDOW 2002
29 #define LIST_WINDOW 2003
33 #define MAX_NEW_KEY_LEN 128
34 #define KEY_MAX_LEN 1024
36 #define REG_FORMAT_5 1
37 #define REG_FORMAT_4 2
42 #define PM_NEW_VALUE 2
43 #define PM_MODIFY_VALUE 3
46 #define HEM_SETDATA (WM_USER+0)
47 #define HEM_GETDATA (WM_USER+1)
49 /******************************************************************************/
52 OPTIONS_AUTO_REFRESH
= 0x01,
53 OPTIONS_READ_ONLY_MODE
= 0x02,
54 OPTIONS_CONFIRM_ON_DELETE
= 0x04,
55 OPTIONS_SAVE_ON_EXIT
= 0x08,
56 OPTIONS_DISPLAY_BINARY_DATA
= 0x10,
57 OPTIONS_VIEW_TREE_ONLY
= 0x20,
58 OPTIONS_VIEW_DATA_ONLY
= 0x40,
65 SEARCH_CONTENT
= 0x08,
72 int nFocusPanel
; /* 0: left 1: right */
75 WCHAR szPath
[MAX_PATH
];
77 extern ChildWnd
* g_pChildWnd
;
79 typedef struct tagLINE_INFO
87 /*******************************************************************************
90 extern HINSTANCE hInst
;
91 extern HWND hFrameWnd
;
92 extern HMENU hMenuFrame
;
93 extern HWND hStatusBar
;
94 extern HMENU hPopupMenus
;
96 extern enum OPTION_FLAGS Options
;
98 extern const WCHAR szChildClass
[];
99 extern WCHAR g_pszDefaultValueName
[];
101 extern DWORD g_columnToSort
;
102 extern BOOL g_invertSort
;
103 extern WCHAR
*g_currentPath
;
104 extern HKEY g_currentRootKey
;
106 /* Registry class names and their indexes */
107 extern const WCHAR
* reg_class_namesW
[];
108 #define INDEX_HKEY_LOCAL_MACHINE 0
109 #define INDEX_HKEY_USERS 1
110 #define INDEX_HKEY_CLASSES_ROOT 2
111 #define INDEX_HKEY_CURRENT_CONFIG 3
112 #define INDEX_HKEY_CURRENT_USER 4
113 #define INDEX_HKEY_DYN_DATA 5
116 void ShowAboutBox(HWND hWnd
);
119 LPWSTR
GetItemFullPath(HWND hwndTV
, HTREEITEM hItem
, BOOL bFull
);
120 LRESULT CALLBACK
ChildWndProc(HWND
, UINT
, WPARAM
, LPARAM
);
123 BOOL
CreateKey(HWND hwnd
, HKEY hKeyRoot
, LPCWSTR keyPath
, LPWSTR newKeyName
);
124 BOOL
CreateValue(HWND hwnd
, HKEY hKeyRoot
, LPCWSTR keyPath
, DWORD valueType
, LPWSTR valueName
);
125 BOOL
ModifyValue(HWND hwnd
, HKEY hKeyRoot
, LPCWSTR keyPath
, LPCWSTR valueName
);
126 BOOL
DeleteKey(HWND hwnd
, HKEY hKeyRoot
, LPCWSTR keyPath
);
127 BOOL
DeleteValue(HWND hwnd
, HKEY hKeyRoot
, LPCWSTR keyPath
, LPCWSTR valueName
);
128 BOOL
RenameValue(HWND hwnd
, HKEY hRootKey
, LPCWSTR keyPath
, LPCWSTR oldName
, LPCWSTR newName
);
129 BOOL
RenameKey(HWND hwnd
, HKEY hRootKey
, LPCWSTR keyPath
, LPCWSTR newName
);
130 int WINAPIV
messagebox(HWND hwnd
, int buttons
, int titleId
, int resId
, ...);
133 LRESULT CALLBACK
FrameWndProc(HWND
, UINT
, WPARAM
, LPARAM
);
134 void SetupStatusBar(HWND hWnd
, BOOL bResize
);
135 void UpdateStatusBar(void);
138 void HexEdit_Register(void);
141 BOOL
update_listview_path(const WCHAR
*path
);
142 void format_value_data(HWND hwndLV
, int index
, DWORD type
, void *data
, DWORD size
);
143 int AddEntryToList(HWND hwndLV
, WCHAR
*Name
, DWORD dwValType
, void *ValBuf
, DWORD dwCount
, int pos
);
144 void OnGetDispInfo(NMLVDISPINFOW
*plvdi
);
145 HWND
CreateListView(HWND hwndParent
, UINT id
);
146 int CALLBACK
CompareFunc(LPARAM lParam1
, LPARAM lParam2
, LPARAM lParamSort
);
147 BOOL
RefreshListView(HWND hwndLV
, HKEY hKeyRoot
, LPCWSTR keyPath
, LPCWSTR highlightValue
);
148 HWND
StartValueRename(HWND hwndLV
);
149 LPWSTR
GetItemText(HWND hwndLV
, UINT item
);
150 WCHAR
*GetValueName(HWND hwndLV
);
151 BOOL
ListWndNotifyProc(HWND hWnd
, WPARAM wParam
, LPARAM lParam
, BOOL
*Result
);
152 BOOL
IsDefaultValue(HWND hwndLV
, int i
);
155 void WINAPIV
output_message(unsigned int id
, ...);
156 void WINAPIV
error_exit(unsigned int id
, ...);
159 void *heap_xalloc(size_t size
);
160 void *heap_xrealloc(void *buf
, size_t size
);
161 char *GetMultiByteString(const WCHAR
*strW
);
162 BOOL
import_registry_file(FILE *reg_file
);
163 void delete_registry_key(WCHAR
*reg_key_name
);
164 BOOL
export_registry_key(WCHAR
*file_name
, WCHAR
*path
, DWORD format
);
167 HWND
CreateTreeView(HWND hwndParent
, LPWSTR pHostName
, UINT id
);
168 BOOL
RefreshTreeView(HWND hWndTV
);
169 BOOL
OnTreeExpanding(HWND hWnd
, NMTREEVIEWW
* pnmtv
);
170 LPWSTR
GetItemPath(HWND hwndTV
, HTREEITEM hItem
, HKEY
* phRootKey
);
171 BOOL
DeleteNode(HWND hwndTV
, HTREEITEM hItem
);
172 HTREEITEM
InsertNode(HWND hwndTV
, HTREEITEM hItem
, LPWSTR name
);
173 HWND
StartKeyRename(HWND hwndTV
);
174 HTREEITEM
FindPathInTree(HWND hwndTV
, LPCWSTR lpKeyName
);
175 HTREEITEM
FindNext(HWND hwndTV
, HTREEITEM hItem
, LPCWSTR sstring
, int mode
, int *row
);
177 #endif /* __MAIN_H__ */