use INT_PTR as return type for dialog callbacks as documented in favor of portability
[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
39 extern HINSTANCE hInst;
40
41 /******************************************************************************/
42
43 enum OPTION_FLAGS {
44 OPTIONS_AUTO_REFRESH = 0x01,
45 OPTIONS_READ_ONLY_MODE = 0x02,
46 OPTIONS_CONFIRM_ON_DELETE = 0x04,
47 OPTIONS_SAVE_ON_EXIT = 0x08,
48 OPTIONS_DISPLAY_BINARY_DATA = 0x10,
49 OPTIONS_VIEW_TREE_ONLY = 0x20,
50 OPTIONS_VIEW_DATA_ONLY = 0x40,
51 };
52
53 typedef struct {
54 HWND hWnd;
55 HWND hTreeWnd;
56 HWND hListWnd;
57 int nFocusPanel; /* 0: left 1: right */
58 int nSplitPos;
59 WINDOWPLACEMENT pos;
60 TCHAR szPath[MAX_PATH];
61 } ChildWnd;
62 extern ChildWnd* g_pChildWnd;
63
64 /*******************************************************************************
65 * Global Variables:
66 */
67 extern HINSTANCE hInst;
68 extern HWND hFrameWnd;
69 extern HMENU hMenuFrame;
70 extern HWND hStatusBar;
71 extern HMENU hPopupMenus;
72 extern HFONT hFont;
73 extern enum OPTION_FLAGS Options;
74
75 extern TCHAR szTitle[];
76 extern TCHAR szFrameClass[];
77 extern TCHAR szChildClass[];
78
79 /* about.c */
80 extern void ShowAboutBox(HWND hWnd);
81
82 /* childwnd.c */
83 extern INT_PTR CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
84
85 /* framewnd.c */
86 extern INT_PTR CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
87 extern void SetupStatusBar(HWND hWnd, BOOL bResize);
88 extern void UpdateStatusBar(void);
89
90 /* listview.c */
91 extern HWND CreateListView(HWND hwndParent, int id);
92 extern BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath);
93 extern LPCTSTR GetValueName(HWND hwndLV, int iStartAt);
94 extern BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
95 extern BOOL IsDefaultValue(HWND hwndLV, int i);
96
97 /* treeview.c */
98 extern HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id);
99 extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
100 extern LPCTSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey);
101
102 /* edit.c */
103 extern BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin);
104
105 #endif /* __MAIN_H__ */