blob: 3dbc7d7b8f2d0fd14d8772736218b3cfd1daba6d [file] [log] [blame]
Alexandre Julliardf752b1242003-08-07 03:10:13 +00001/*
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#ifdef __cplusplus
25extern "C" {
26#endif
27
28
29#include "resource.h"
30
31
32#define STATUS_WINDOW 2001
33#define TREE_WINDOW 2002
34#define LIST_WINDOW 2003
35
36#define MAX_LOADSTRING 100
37#define SPLIT_WIDTH 5
38#define MAX_NAME_LEN 500
39
40
41/******************************************************************************/
42
43enum 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
53typedef 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
63/*******************************************************************************
64 * Global Variables:
65 */
66extern HINSTANCE hInst;
67extern HWND hFrameWnd;
68extern HMENU hMenuFrame;
69extern HWND hStatusBar;
70extern HFONT hFont;
71extern enum OPTION_FLAGS Options;
72
73extern TCHAR szTitle[];
74extern TCHAR szFrameClass[];
75extern TCHAR szChildClass[];
76
77/*******************************************************************************
78 * Dynamically load all things that depend on user32.dll
79 */
80#include "winuser.h"
81#include "wingdi.h"
82#include "commctrl.h"
83#include "commdlg.h"
84
85#ifdef REGEDIT_DECLARE_FUNCTIONS
86#define d(x) typeof(x) *p##x = NULL;
87#else
88#define d(x) extern typeof(x) *p##x;
89#endif
90
91d(BeginDeferWindowPos)
92d(BeginPaint)
93d(CallWindowProcA)
94d(CheckMenuItem)
95d(CloseClipboard)
96d(CommDlgExtendedError)
97d(CreateStatusWindowA)
98d(CreateWindowExA)
99d(DefWindowProcA)
100d(DeferWindowPos)
101d(DeleteDC)
102d(DeleteObject)
103d(DestroyMenu)
104d(DestroyWindow)
105d(DialogBoxParamA)
106d(DispatchMessageA)
107d(EmptyClipboard)
108d(EndDeferWindowPos)
109d(EndPaint)
110d(EndDialog)
111d(FillRect)
112d(GetCapture)
113d(GetClientRect)
114d(GetCursorPos)
115d(GetDC)
116d(GetDlgItem)
117d(GetMenu)
118d(GetMessageA)
119d(GetOpenFileNameA)
120d(GetSaveFileNameA)
121d(GetStockObject)
122d(GetSubMenu)
123d(GetSystemMetrics)
124d(ImageList_Add)
125d(ImageList_Create)
126d(ImageList_GetImageCount)
127d(InitCommonControls)
128d(InvertRect)
129d(IsWindowVisible)
130d(LoadAcceleratorsA)
131d(LoadBitmapA)
132d(LoadCursorA)
133d(LoadIconA)
134d(LoadImageA)
135d(LoadMenuA)
136d(LoadStringA)
137d(MessageBeep)
138d(MoveWindow)
139d(OpenClipboard)
140d(PostQuitMessage)
141d(PrintDlgA)
142d(RegisterClassExA)
143d(RegisterClipboardFormatA)
144d(ReleaseCapture)
145d(ReleaseDC)
146d(ScreenToClient)
147d(SendMessageA)
148d(SetCapture)
149d(SetCursor)
150d(SetFocus)
151d(SetWindowLongA)
152d(SetWindowTextA)
153d(ShowWindow)
154d(TranslateAccelerator)
155d(TranslateMessage)
156d(UpdateWindow)
157d(WinHelpA)
158d(wsprintfA)
159
160#undef d
161
162#define BeginDeferWindowPos pBeginDeferWindowPos
163#define BeginPaint pBeginPaint
164#define CallWindowProcA pCallWindowProcA
165#define CheckMenuItem pCheckMenuItem
166#define CloseClipboard pCloseClipboard
167#define CommDlgExtendedError pCommDlgExtendedError
168#define CreateStatusWindowA pCreateStatusWindowA
169#define CreateWindowExA pCreateWindowExA
170#define DefWindowProcA pDefWindowProcA
171#define DeferWindowPos pDeferWindowPos
172#define DeleteDC pDeleteDC
173#define DeleteObject pDeleteObject
174#define DestroyMenu pDestroyMenu
175#define DestroyWindow pDestroyWindow
176#define DialogBoxParamA pDialogBoxParamA
177#define DispatchMessageA pDispatchMessageA
178#define EmptyClipboard pEmptyClipboard
179#define EndDeferWindowPos pEndDeferWindowPos
180#define EndDialog pEndDialog
181#define EndPaint pEndPaint
182#define FillRect pFillRect
183#define GetCapture pGetCapture
184#define GetClientRect pGetClientRect
185#define GetCursorPos pGetCursorPos
186#define GetDC pGetDC
187#define GetDlgItem pGetDlgItem
188#define GetMenu pGetMenu
189#define GetMessageA pGetMessageA
190#define GetOpenFileNameA pGetOpenFileNameA
191#define GetSaveFileNameA pGetSaveFileNameA
192#define GetStockObject pGetStockObject
193#define GetSubMenu pGetSubMenu
194#define GetSystemMetrics pGetSystemMetrics
195#define ImageList_Add pImageList_Add
196#define ImageList_Create pImageList_Create
197#define ImageList_GetImageCount pImageList_GetImageCount
198#define InitCommonControls pInitCommonControls
199#define InvertRect pInvertRect
200#define IsWindowVisible pIsWindowVisible
201#define LoadAcceleratorsA pLoadAcceleratorsA
202#define LoadBitmapA pLoadBitmapA
203#define LoadCursorA pLoadCursorA
204#define LoadIconA pLoadIconA
205#define LoadImageA pLoadImageA
206#define LoadMenuA pLoadMenuA
207#define LoadStringA pLoadStringA
208#define MessageBeep pMessageBeep
209#define MoveWindow pMoveWindow
210#define OpenClipboard pOpenClipboard
211#define PostQuitMessage pPostQuitMessage
212#define PrintDlgA pPrintDlgA
213#define RegisterClassExA pRegisterClassExA
214#define RegisterClipboardFormatA pRegisterClipboardFormatA
215#define ReleaseCapture pReleaseCapture
216#define ReleaseDC pReleaseDC
217#define ScreenToClient pScreenToClient
218#define SendMessageA pSendMessageA
219#define SetCapture pSetCapture
220#define SetCursor pSetCursor
221#define SetFocus pSetFocus
222#define SetWindowLongA pSetWindowLongA
223#define SetWindowTextA pSetWindowTextA
224#define ShowWindow pShowWindow
225#define TranslateAccelerator pTranslateAccelerator
226#define TranslateMessage pTranslateMessage
227#define UpdateWindow pUpdateWindow
228#define WinHelpA pWinHelpA
229#define wsprintfA pwsprintfA
230
231#ifdef __cplusplus
232};
233#endif
234
235/* about.c */
236extern void ShowAboutBox(HWND hWnd);
237
238/* childwnd.c */
239extern LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
240
241/* framewnd.c */
242extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
243extern void SetupStatusBar(HWND hWnd, BOOL bResize);
244extern void UpdateStatusBar(void);
245
246/* listview.c */
247extern HWND CreateListView(HWND hwndParent, int id);
248extern BOOL RefreshListView(HWND hwndTV, HKEY hKey, LPTSTR keyPath);
249
250/* treeview.c */
251extern HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id);
252extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
253extern HKEY FindRegRoot(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, int max);
254
255#endif /* __MAIN_H__ */