Alexandre Julliard | f752b124 | 2003-08-07 03:10:13 +0000 | [diff] [blame^] | 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 | #ifdef __cplusplus |
| 25 | extern "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 | |
| 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 | |
| 63 | /******************************************************************************* |
| 64 | * Global Variables: |
| 65 | */ |
| 66 | extern HINSTANCE hInst; |
| 67 | extern HWND hFrameWnd; |
| 68 | extern HMENU hMenuFrame; |
| 69 | extern HWND hStatusBar; |
| 70 | extern HFONT hFont; |
| 71 | extern enum OPTION_FLAGS Options; |
| 72 | |
| 73 | extern TCHAR szTitle[]; |
| 74 | extern TCHAR szFrameClass[]; |
| 75 | extern 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 | |
| 91 | d(BeginDeferWindowPos) |
| 92 | d(BeginPaint) |
| 93 | d(CallWindowProcA) |
| 94 | d(CheckMenuItem) |
| 95 | d(CloseClipboard) |
| 96 | d(CommDlgExtendedError) |
| 97 | d(CreateStatusWindowA) |
| 98 | d(CreateWindowExA) |
| 99 | d(DefWindowProcA) |
| 100 | d(DeferWindowPos) |
| 101 | d(DeleteDC) |
| 102 | d(DeleteObject) |
| 103 | d(DestroyMenu) |
| 104 | d(DestroyWindow) |
| 105 | d(DialogBoxParamA) |
| 106 | d(DispatchMessageA) |
| 107 | d(EmptyClipboard) |
| 108 | d(EndDeferWindowPos) |
| 109 | d(EndPaint) |
| 110 | d(EndDialog) |
| 111 | d(FillRect) |
| 112 | d(GetCapture) |
| 113 | d(GetClientRect) |
| 114 | d(GetCursorPos) |
| 115 | d(GetDC) |
| 116 | d(GetDlgItem) |
| 117 | d(GetMenu) |
| 118 | d(GetMessageA) |
| 119 | d(GetOpenFileNameA) |
| 120 | d(GetSaveFileNameA) |
| 121 | d(GetStockObject) |
| 122 | d(GetSubMenu) |
| 123 | d(GetSystemMetrics) |
| 124 | d(ImageList_Add) |
| 125 | d(ImageList_Create) |
| 126 | d(ImageList_GetImageCount) |
| 127 | d(InitCommonControls) |
| 128 | d(InvertRect) |
| 129 | d(IsWindowVisible) |
| 130 | d(LoadAcceleratorsA) |
| 131 | d(LoadBitmapA) |
| 132 | d(LoadCursorA) |
| 133 | d(LoadIconA) |
| 134 | d(LoadImageA) |
| 135 | d(LoadMenuA) |
| 136 | d(LoadStringA) |
| 137 | d(MessageBeep) |
| 138 | d(MoveWindow) |
| 139 | d(OpenClipboard) |
| 140 | d(PostQuitMessage) |
| 141 | d(PrintDlgA) |
| 142 | d(RegisterClassExA) |
| 143 | d(RegisterClipboardFormatA) |
| 144 | d(ReleaseCapture) |
| 145 | d(ReleaseDC) |
| 146 | d(ScreenToClient) |
| 147 | d(SendMessageA) |
| 148 | d(SetCapture) |
| 149 | d(SetCursor) |
| 150 | d(SetFocus) |
| 151 | d(SetWindowLongA) |
| 152 | d(SetWindowTextA) |
| 153 | d(ShowWindow) |
| 154 | d(TranslateAccelerator) |
| 155 | d(TranslateMessage) |
| 156 | d(UpdateWindow) |
| 157 | d(WinHelpA) |
| 158 | d(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 */ |
| 236 | extern void ShowAboutBox(HWND hWnd); |
| 237 | |
| 238 | /* childwnd.c */ |
| 239 | extern LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM); |
| 240 | |
| 241 | /* framewnd.c */ |
| 242 | extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM); |
| 243 | extern void SetupStatusBar(HWND hWnd, BOOL bResize); |
| 244 | extern void UpdateStatusBar(void); |
| 245 | |
| 246 | /* listview.c */ |
| 247 | extern HWND CreateListView(HWND hwndParent, int id); |
| 248 | extern BOOL RefreshListView(HWND hwndTV, HKEY hKey, LPTSTR keyPath); |
| 249 | |
| 250 | /* treeview.c */ |
| 251 | extern HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id); |
| 252 | extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv); |
| 253 | extern HKEY FindRegRoot(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, int max); |
| 254 | |
| 255 | #endif /* __MAIN_H__ */ |