push b7454c0be268e63e23db077ecd5238ed6dc9ec0b
[wine/hacks.git] / programs / regedit / main.h
bloba2a3c19bc5f258abbd1f1b8192cfbb1890ff9e21
1 /*
2 * Regedit definitions
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
21 #ifndef __MAIN_H__
22 #define __MAIN_H__
24 #include "resource.h"
27 #define STATUS_WINDOW 2001
28 #define TREE_WINDOW 2002
29 #define LIST_WINDOW 2003
31 #define SPLIT_WIDTH 5
33 #define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
35 #define PM_MODIFYVALUE 0
36 #define PM_NEW 1
38 #define MAX_NEW_KEY_LEN 128
40 #define WM_NOTIFY_REFLECT (WM_USER+1024)
42 /* HexEdit Class */
43 #define HEXEDIT_CLASS TEXT("HexEdit")
44 #define HEM_SETDATA (WM_USER+0)
45 #define HEM_GETDATA (WM_USER+1)
47 extern HINSTANCE hInst;
49 /******************************************************************************/
51 enum OPTION_FLAGS {
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,
61 enum SEARCH_FLAGS {
62 SEARCH_WHOLE = 0x01,
63 SEARCH_KEYS = 0x02,
64 SEARCH_VALUES = 0x04,
65 SEARCH_CONTENT = 0x08,
68 typedef struct {
69 HWND hWnd;
70 HWND hTreeWnd;
71 HWND hListWnd;
72 int nFocusPanel; /* 0: left 1: right */
73 int nSplitPos;
74 WINDOWPLACEMENT pos;
75 TCHAR szPath[MAX_PATH];
76 } ChildWnd;
77 extern ChildWnd* g_pChildWnd;
79 /*******************************************************************************
80 * Global Variables:
82 extern HINSTANCE hInst;
83 extern HWND hFrameWnd;
84 extern HMENU hMenuFrame;
85 extern HWND hStatusBar;
86 extern HMENU hPopupMenus;
87 extern HFONT hFont;
88 extern enum OPTION_FLAGS Options;
90 extern TCHAR szTitle[];
91 extern const TCHAR szFrameClass[];
92 extern const TCHAR szChildClass[];
93 extern TCHAR g_pszDefaultValueName[];
95 /* about.c */
96 extern void ShowAboutBox(HWND hWnd);
98 /* childwnd.c */
99 extern LPCTSTR GetRootKeyName(HKEY hRootKey);
100 extern LPTSTR GetItemFullPath(HWND hwndTV, HTREEITEM hItem, BOOL bFull);
101 extern LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
103 /* framewnd.c */
104 extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
105 extern void SetupStatusBar(HWND hWnd, BOOL bResize);
106 extern void UpdateStatusBar(void);
108 /* listview.c */
109 extern HWND CreateListView(HWND hwndParent, int id);
110 extern BOOL RefreshListView(HWND hwndLV, HKEY hKeyRoot, LPCTSTR keyPath, LPCTSTR highlightValue);
111 extern HWND StartValueRename(HWND hwndLV);
112 extern LPCTSTR GetValueName(HWND hwndLV);
113 extern BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
114 extern BOOL IsDefaultValue(HWND hwndLV, int i);
116 /* treeview.c */
117 extern HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id);
118 extern BOOL RefreshTreeView(HWND hWndTV);
119 extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
120 extern LPTSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey);
121 extern BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem);
122 extern HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPTSTR name);
123 extern HWND StartKeyRename(HWND hwndTV);
124 extern HTREEITEM FindPathInTree(HWND hwndTV, LPCTSTR lpKeyName);
125 extern HTREEITEM FindNext(HWND hwndTV, HTREEITEM hItem, LPCTSTR sstring, int mode, int *row);
127 /* edit.c */
128 extern BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPTSTR newKeyName);
129 extern BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, DWORD valueType, LPTSTR valueName);
130 extern BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPCTSTR valueName);
131 extern BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath);
132 extern BOOL DeleteValue(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPCTSTR valueName);
133 extern BOOL RenameValue(HWND hwnd, HKEY hRootKey, LPCTSTR keyPath, LPCTSTR oldName, LPCTSTR newName);
134 extern BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCTSTR keyPath, LPCTSTR newName);
135 extern void error(HWND hwnd, INT resId, ...);
137 /* hexedit.c */
138 extern void HexEdit_Register(void);
139 extern void HexEdit_Unregister(void);
141 #endif /* __MAIN_H__ */