Synchronize with trunk's revision r57599.
[reactos.git] / base / applications / regedit / main.h
1 /*
2 * Regedit definitions
3 *
4 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
5 *
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.
10 *
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.
15 *
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
19 */
20
21 #pragma once
22
23 #include "resource.h"
24
25
26 #define STATUS_WINDOW 2001
27 #define TREE_WINDOW 2002
28 #define LIST_WINDOW 2003
29
30 #define SPLIT_WIDTH 5
31 #define SPLIT_MIN 30
32
33 #define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
34
35 #define PM_MODIFYVALUE 0
36 #define PM_NEW 1
37 #define PM_TREECONTEXT 2
38 #define PM_HEXEDIT 3
39
40 #define MAX_NEW_KEY_LEN 128
41
42 extern HINSTANCE hInst;
43
44 /******************************************************************************/
45
46 enum OPTION_FLAGS
47 {
48 OPTIONS_AUTO_REFRESH = 0x01,
49 OPTIONS_READ_ONLY_MODE = 0x02,
50 OPTIONS_CONFIRM_ON_DELETE = 0x04,
51 OPTIONS_SAVE_ON_EXIT = 0x08,
52 OPTIONS_DISPLAY_BINARY_DATA = 0x10,
53 OPTIONS_VIEW_TREE_ONLY = 0x20,
54 OPTIONS_VIEW_DATA_ONLY = 0x40,
55 };
56
57 typedef struct
58 {
59 HWND hWnd;
60 HWND hTreeWnd;
61 HWND hListWnd;
62 HWND hAddressBarWnd;
63 HWND hAddressBtnWnd;
64 int nFocusPanel; /* 0: left 1: right */
65 int nSplitPos;
66 WINDOWPLACEMENT pos;
67 WCHAR szPath[MAX_PATH];
68 } ChildWnd;
69 extern ChildWnd* g_pChildWnd;
70
71 /*******************************************************************************
72 * Global Variables:
73 */
74 extern HINSTANCE hInst;
75 extern HWND hFrameWnd;
76 extern HMENU hMenuFrame;
77 extern HWND hStatusBar;
78 extern HMENU hPopupMenus;
79 extern HFONT hFont;
80 extern enum OPTION_FLAGS Options;
81
82 extern WCHAR szTitle[];
83 extern WCHAR szFrameClass[];
84 extern WCHAR szChildClass[];
85
86 extern const WCHAR g_szGeneralRegKey[];
87
88 /* about.c */
89 extern void ShowAboutBox(HWND hWnd);
90
91 /* childwnd.c */
92 extern LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
93 extern void ResizeWnd(int cx, int cy);
94 extern LPCWSTR get_root_key_name(HKEY hRootKey);
95
96 /* error.c */
97 extern int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode, ...);
98 extern int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMessage, ...);
99
100 /* find.c */
101 extern void FindDialog(HWND hWnd);
102 extern BOOL FindNext(HWND hWnd);
103
104 /* framewnd.c */
105 extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
106 extern void SetupStatusBar(HWND hWnd, BOOL bResize);
107 extern void UpdateStatusBar(void);
108 extern BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCWSTR keyName);
109 extern BOOL ExportRegistryFile(HWND hWnd);
110
111 /* listview.c */
112 extern HWND CreateListView(HWND hwndParent, HMENU id);
113 extern BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath);
114 extern LPCWSTR GetValueName(HWND hwndLV, int iStartAt);
115 extern BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
116 extern BOOL IsDefaultValue(HWND hwndLV, int i);
117
118 /* regedit.c */
119 LPCWSTR getAppName(void);
120
121 /* treeview.c */
122 extern HWND CreateTreeView(HWND hwndParent, LPWSTR pHostName, HMENU id);
123 extern BOOL RefreshTreeView(HWND hWndTV);
124 extern BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem);
125 extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
126 extern LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey);
127 extern BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem);
128 extern HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name);
129 extern HWND StartKeyRename(HWND hwndTV);
130 extern BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem);
131 extern BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath);
132 extern void DestroyTreeView( void );
133 extern void DestroyListView( HWND hwndLV );
134 extern void DestroyMainMenu( void );
135
136 /* edit.c */
137 extern BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCWSTR valueName, BOOL EditBin);
138 extern BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath);
139 extern LONG RenameKey(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpNewName);
140 extern LONG RenameValue(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpDestValue, LPCWSTR lpSrcValue);
141 extern LONG QueryStringValue(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpValueName, LPWSTR pszBuffer, DWORD dwBufferLen);
142 extern BOOL GetKeyName(LPWSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCWSTR lpSubKey);
143
144 /* security.c */
145 extern BOOL RegKeyEditPermissions(HWND hWndOwner, HKEY hKey, LPCWSTR lpMachine, LPCWSTR lpKeyName);
146
147 /* settings.c */
148 extern void LoadSettings(void);
149 extern void SaveSettings(void);
150
151 /* EOF */