main.h 5.05 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * Regedit definitions
 *
 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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
19 20 21 22 23 24 25 26 27 28 29 30
 */

#ifndef __MAIN_H__
#define __MAIN_H__

#include "resource.h"


#define STATUS_WINDOW   2001
#define TREE_WINDOW     2002
#define LIST_WINDOW     2003

31
#define	SPLIT_WIDTH	5
32

33
#define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
34

35 36 37
#define PM_MODIFYVALUE  0
#define PM_NEW          1

38 39
#define MAX_NEW_KEY_LEN 128

40 41
#define WM_NOTIFY_REFLECT (WM_USER+1024)

42 43 44 45
/* HexEdit Class */
#define HEM_SETDATA (WM_USER+0)
#define HEM_GETDATA (WM_USER+1)

46 47
extern HINSTANCE hInst;

48 49 50
/******************************************************************************/

enum OPTION_FLAGS {
51 52 53 54
    OPTIONS_AUTO_REFRESH            	   = 0x01,
    OPTIONS_READ_ONLY_MODE          	   = 0x02,
    OPTIONS_CONFIRM_ON_DELETE       	   = 0x04,
    OPTIONS_SAVE_ON_EXIT         	   = 0x08,
55 56 57 58 59
    OPTIONS_DISPLAY_BINARY_DATA    	   = 0x10,
    OPTIONS_VIEW_TREE_ONLY       	   = 0x20,
    OPTIONS_VIEW_DATA_ONLY      	   = 0x40,
};

60 61 62 63 64 65 66
enum SEARCH_FLAGS {
    SEARCH_WHOLE                           = 0x01,
    SEARCH_KEYS                            = 0x02,
    SEARCH_VALUES                          = 0x04,
    SEARCH_CONTENT                         = 0x08,
};

67
typedef struct {
68
    HWND    hWnd;
69 70 71
    HWND    hTreeWnd;
    HWND    hListWnd;
    int     nFocusPanel;      /* 0: left  1: right */
72 73
    int	    nSplitPos;
    WINDOWPLACEMENT pos;
74
    WCHAR   szPath[MAX_PATH];
75
} ChildWnd;
76
extern ChildWnd* g_pChildWnd;
77 78 79 80 81 82 83 84

/*******************************************************************************
 * Global Variables:
 */
extern HINSTANCE hInst;
extern HWND      hFrameWnd;
extern HMENU     hMenuFrame;
extern HWND      hStatusBar;
85
extern HMENU     hPopupMenus;
86 87 88
extern HFONT     hFont;
extern enum OPTION_FLAGS Options;

89 90 91
extern WCHAR szTitle[];
extern const WCHAR szFrameClass[];
extern const WCHAR szChildClass[];
92
extern const WCHAR szHexEditClass[];
93
extern WCHAR g_pszDefaultValueName[];
94

95 96 97 98 99 100 101 102 103 104 105
/* Registry class names and their indexes */
extern const WCHAR* reg_class_namesW[];
#define INDEX_HKEY_LOCAL_MACHINE    0
#define INDEX_HKEY_USERS            1
#define INDEX_HKEY_CLASSES_ROOT     2
#define INDEX_HKEY_CURRENT_CONFIG   3
#define INDEX_HKEY_CURRENT_USER     4
#define INDEX_HKEY_DYN_DATA         5



106 107 108 109
/* about.c */
extern void ShowAboutBox(HWND hWnd);

/* childwnd.c */
110
extern LPWSTR GetItemFullPath(HWND hwndTV, HTREEITEM hItem, BOOL bFull);
111 112 113 114 115 116 117 118
extern LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);

/* framewnd.c */
extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
extern void SetupStatusBar(HWND hWnd, BOOL bResize);
extern void UpdateStatusBar(void);

/* listview.c */
119
extern HWND CreateListView(HWND hwndParent, UINT id);
120
extern BOOL RefreshListView(HWND hwndLV, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR highlightValue);
121
extern HWND StartValueRename(HWND hwndLV);
122
extern LPWSTR GetItemText(HWND hwndLV, UINT item);
123
extern LPCWSTR GetValueName(HWND hwndLV);
Zimler Attila's avatar
Zimler Attila committed
124 125
extern BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
extern BOOL IsDefaultValue(HWND hwndLV, int i);
126 127

/* treeview.c */
128
extern HWND CreateTreeView(HWND hwndParent, LPWSTR pHostName, UINT id);
Crestez Leonard's avatar
Crestez Leonard committed
129
extern BOOL RefreshTreeView(HWND hWndTV);
130
extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEWW* pnmtv);
131
extern LPWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey);
132
extern BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem);
133
extern HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name);
134
extern HWND StartKeyRename(HWND hwndTV);
135
extern HTREEITEM FindPathInTree(HWND hwndTV, LPCWSTR lpKeyName);
136
extern HTREEITEM FindNext(HWND hwndTV, HTREEITEM hItem, LPCWSTR sstring, int mode, int *row);
137

138
/* edit.c */
139
extern BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPWSTR newKeyName);
140
extern BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPWSTR valueName);
141
extern BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName);
142 143
extern BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath);
extern BOOL DeleteValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName, BOOL showMessageBox);
144
extern BOOL RenameValue(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR oldName, LPCWSTR newName);
145
extern BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR newName);
146
extern void error(HWND hwnd, INT resId, ...);
147

148 149 150
/* hexedit.c */
extern void HexEdit_Register(void);

151
#endif /* __MAIN_H__ */