Revert, thx Thomas, wasnt sure.
[reactos.git] / reactos / subsys / system / 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #ifndef __MAIN_H__
22 #define __MAIN_H__
23
24 #include "resource.h"
25
26
27 #define STATUS_WINDOW 2001
28 #define TREE_WINDOW 2002
29 #define LIST_WINDOW 2003
30
31 #define SPLIT_WIDTH 5
32 #define SPLIT_MIN 30
33
34 #define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
35
36 #define PM_MODIFYVALUE 0
37 #define PM_NEW 1
38 #define PM_TREECONTEXT 2
39
40 #define MAX_NEW_KEY_LEN 128
41
42 extern HINSTANCE hInst;
43
44 /******************************************************************************/
45
46 enum OPTION_FLAGS {
47 OPTIONS_AUTO_REFRESH = 0x01,
48 OPTIONS_READ_ONLY_MODE = 0x02,
49 OPTIONS_CONFIRM_ON_DELETE = 0x04,
50 OPTIONS_SAVE_ON_EXIT = 0x08,
51 OPTIONS_DISPLAY_BINARY_DATA = 0x10,
52 OPTIONS_VIEW_TREE_ONLY = 0x20,
53 OPTIONS_VIEW_DATA_ONLY = 0x40,
54 };
55
56 typedef struct {
57 HWND hWnd;
58 HWND hTreeWnd;
59 HWND hListWnd;
60 int nFocusPanel; /* 0: left 1: right */
61 int nSplitPos;
62 WINDOWPLACEMENT pos;
63 TCHAR szPath[MAX_PATH];
64 } ChildWnd;
65 extern ChildWnd* g_pChildWnd;
66
67 /*******************************************************************************
68 * Global Variables:
69 */
70 extern HINSTANCE hInst;
71 extern HWND hFrameWnd;
72 extern HMENU hMenuFrame;
73 extern HWND hStatusBar;
74 extern HMENU hPopupMenus;
75 extern HFONT hFont;
76 extern enum OPTION_FLAGS Options;
77
78 extern TCHAR szTitle[];
79 extern TCHAR szFrameClass[];
80 extern TCHAR szChildClass[];
81
82 extern const TCHAR g_szGeneralRegKey[];
83
84 /* about.c */
85 extern void ShowAboutBox(HWND hWnd);
86
87 /* childwnd.c */
88 extern LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
89
90 /* find.c */
91 extern void FindDialog(HWND hWnd);
92 extern BOOL FindNext(HWND hWnd);
93
94 /* framewnd.c */
95 extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
96 extern void SetupStatusBar(HWND hWnd, BOOL bResize);
97 extern void UpdateStatusBar(void);
98 extern BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCTSTR keyName);
99 extern BOOL ExportRegistryFile(HWND hWnd);
100
101 /* listview.c */
102 extern HWND CreateListView(HWND hwndParent, HMENU id);
103 extern BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath);
104 extern LPCTSTR GetValueName(HWND hwndLV, int iStartAt);
105 extern BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
106 extern BOOL IsDefaultValue(HWND hwndLV, int i);
107
108 /* treeview.c */
109 extern HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, HMENU id);
110 extern BOOL RefreshTreeView(HWND hWndTV);
111 extern BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem);
112 extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
113 extern LPCTSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey);
114 extern BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem);
115 extern HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPTSTR name);
116 extern HWND StartKeyRename(HWND hwndTV);
117 extern BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem);
118 extern BOOL SelectNode(HWND hwndTV, LPCTSTR keyPath);
119 extern void DestroyTreeView( void );
120 extern void DestroyListView( HWND hwndLV );
121 extern void DestroyMainMenu( void );
122
123 /* edit.c */
124 extern BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin);
125 extern BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath);
126
127 #endif /* __MAIN_H__ */