2003-08-07 05:10:13 +02:00
|
|
|
/*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-08-07 05:10:13 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MAIN_H__
|
|
|
|
#define __MAIN_H__
|
|
|
|
|
2018-05-21 15:34:50 +02:00
|
|
|
#include <stdio.h>
|
2003-08-07 05:10:13 +02:00
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
#define STATUS_WINDOW 2001
|
|
|
|
#define TREE_WINDOW 2002
|
|
|
|
#define LIST_WINDOW 2003
|
|
|
|
|
2003-12-08 23:48:07 +01:00
|
|
|
#define SPLIT_WIDTH 5
|
2003-08-07 05:10:13 +02:00
|
|
|
|
2018-05-21 15:34:53 +02:00
|
|
|
#define MAX_NEW_KEY_LEN 128
|
|
|
|
#define KEY_MAX_LEN 1024
|
|
|
|
|
|
|
|
#define REG_FORMAT_5 1
|
|
|
|
#define REG_FORMAT_4 2
|
2004-03-15 21:19:38 +01:00
|
|
|
|
2017-05-22 15:03:11 +02:00
|
|
|
/* Pop-Up Menus */
|
2017-05-24 14:48:33 +02:00
|
|
|
#define PM_COMPUTER 0
|
|
|
|
#define PM_TREEVIEW 1
|
|
|
|
#define PM_NEW_VALUE 2
|
|
|
|
#define PM_MODIFY_VALUE 3
|
2017-05-22 15:03:11 +02:00
|
|
|
|
2005-04-14 13:30:31 +02:00
|
|
|
/* HexEdit Class */
|
|
|
|
#define HEM_SETDATA (WM_USER+0)
|
|
|
|
#define HEM_GETDATA (WM_USER+1)
|
|
|
|
|
2003-08-07 05:10:13 +02:00
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
enum OPTION_FLAGS {
|
2003-12-08 23:48:07 +01:00
|
|
|
OPTIONS_AUTO_REFRESH = 0x01,
|
|
|
|
OPTIONS_READ_ONLY_MODE = 0x02,
|
|
|
|
OPTIONS_CONFIRM_ON_DELETE = 0x04,
|
|
|
|
OPTIONS_SAVE_ON_EXIT = 0x08,
|
2003-08-07 05:10:13 +02:00
|
|
|
OPTIONS_DISPLAY_BINARY_DATA = 0x10,
|
|
|
|
OPTIONS_VIEW_TREE_ONLY = 0x20,
|
|
|
|
OPTIONS_VIEW_DATA_ONLY = 0x40,
|
|
|
|
};
|
|
|
|
|
2005-10-26 14:07:55 +02:00
|
|
|
enum SEARCH_FLAGS {
|
|
|
|
SEARCH_WHOLE = 0x01,
|
|
|
|
SEARCH_KEYS = 0x02,
|
|
|
|
SEARCH_VALUES = 0x04,
|
|
|
|
SEARCH_CONTENT = 0x08,
|
|
|
|
};
|
|
|
|
|
2003-08-07 05:10:13 +02:00
|
|
|
typedef struct {
|
2003-12-08 23:48:07 +01:00
|
|
|
HWND hWnd;
|
2003-08-07 05:10:13 +02:00
|
|
|
HWND hTreeWnd;
|
|
|
|
HWND hListWnd;
|
|
|
|
int nFocusPanel; /* 0: left 1: right */
|
2003-12-08 23:48:07 +01:00
|
|
|
int nSplitPos;
|
|
|
|
WINDOWPLACEMENT pos;
|
2008-08-25 23:00:35 +02:00
|
|
|
WCHAR szPath[MAX_PATH];
|
2003-08-07 05:10:13 +02:00
|
|
|
} ChildWnd;
|
2003-12-12 05:08:59 +01:00
|
|
|
extern ChildWnd* g_pChildWnd;
|
2003-08-07 05:10:13 +02:00
|
|
|
|
2017-07-12 13:09:49 +02:00
|
|
|
typedef struct tagLINE_INFO
|
|
|
|
{
|
|
|
|
WCHAR *name;
|
|
|
|
DWORD dwValType;
|
|
|
|
void *val;
|
|
|
|
size_t val_len;
|
|
|
|
} LINE_INFO;
|
|
|
|
|
2003-08-07 05:10:13 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
* Global Variables:
|
|
|
|
*/
|
|
|
|
extern HINSTANCE hInst;
|
|
|
|
extern HWND hFrameWnd;
|
|
|
|
extern HMENU hMenuFrame;
|
|
|
|
extern HWND hStatusBar;
|
2004-01-16 03:14:19 +01:00
|
|
|
extern HMENU hPopupMenus;
|
2003-08-07 05:10:13 +02:00
|
|
|
extern HFONT hFont;
|
|
|
|
extern enum OPTION_FLAGS Options;
|
|
|
|
|
2011-04-16 10:06:48 +02:00
|
|
|
extern WCHAR szTitle[];
|
|
|
|
extern const WCHAR szFrameClass[];
|
|
|
|
extern const WCHAR szChildClass[];
|
2011-04-16 10:07:03 +02:00
|
|
|
extern const WCHAR szHexEditClass[];
|
2008-08-31 16:49:43 +02:00
|
|
|
extern WCHAR g_pszDefaultValueName[];
|
2003-08-07 05:10:13 +02:00
|
|
|
|
2017-07-12 13:09:49 +02:00
|
|
|
extern DWORD g_columnToSort;
|
|
|
|
extern BOOL g_invertSort;
|
|
|
|
extern WCHAR *g_currentPath;
|
|
|
|
extern HKEY g_currentRootKey;
|
|
|
|
|
2008-08-10 13:52:44 +02:00
|
|
|
/* 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
|
|
|
|
|
2003-08-07 05:10:13 +02:00
|
|
|
/* about.c */
|
2018-05-21 15:35:01 +02:00
|
|
|
void ShowAboutBox(HWND hWnd);
|
2003-08-07 05:10:13 +02:00
|
|
|
|
|
|
|
/* childwnd.c */
|
2018-05-21 15:35:01 +02:00
|
|
|
LPWSTR GetItemFullPath(HWND hwndTV, HTREEITEM hItem, BOOL bFull);
|
|
|
|
LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
|
2003-08-07 05:10:13 +02:00
|
|
|
|
2018-05-21 15:35:02 +02:00
|
|
|
/* edit.c */
|
|
|
|
BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPWSTR newKeyName);
|
|
|
|
BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPWSTR valueName);
|
|
|
|
BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName);
|
|
|
|
BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath);
|
2018-05-28 15:48:06 +02:00
|
|
|
BOOL DeleteValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName);
|
2018-05-21 15:35:02 +02:00
|
|
|
BOOL RenameValue(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR oldName, LPCWSTR newName);
|
|
|
|
BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR newName);
|
|
|
|
int WINAPIV messagebox(HWND hwnd, int buttons, int titleId, int resId, ...);
|
|
|
|
|
2003-08-07 05:10:13 +02:00
|
|
|
/* framewnd.c */
|
2018-05-21 15:35:01 +02:00
|
|
|
LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
|
|
|
|
void SetupStatusBar(HWND hWnd, BOOL bResize);
|
|
|
|
void UpdateStatusBar(void);
|
2003-08-07 05:10:13 +02:00
|
|
|
|
2018-05-21 15:35:02 +02:00
|
|
|
/* hexedit.c */
|
|
|
|
void HexEdit_Register(void);
|
|
|
|
|
2003-08-07 05:10:13 +02:00
|
|
|
/* listview.c */
|
2018-05-21 15:35:01 +02:00
|
|
|
BOOL update_listview_path(const WCHAR *path);
|
|
|
|
void format_value_data(HWND hwndLV, int index, DWORD type, void *data, DWORD size);
|
|
|
|
int AddEntryToList(HWND hwndLV, WCHAR *Name, DWORD dwValType, void *ValBuf, DWORD dwCount, int pos);
|
|
|
|
void OnGetDispInfo(NMLVDISPINFOW *plvdi);
|
|
|
|
HWND CreateListView(HWND hwndParent, UINT id);
|
|
|
|
int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
|
|
|
|
BOOL RefreshListView(HWND hwndLV, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR highlightValue);
|
|
|
|
HWND StartValueRename(HWND hwndLV);
|
|
|
|
LPWSTR GetItemText(HWND hwndLV, UINT item);
|
|
|
|
LPCWSTR GetValueName(HWND hwndLV);
|
|
|
|
BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
|
|
|
|
BOOL IsDefaultValue(HWND hwndLV, int i);
|
2003-08-07 05:10:13 +02:00
|
|
|
|
2018-05-21 15:34:52 +02:00
|
|
|
/* regedit.c */
|
|
|
|
void WINAPIV output_message(unsigned int id, ...);
|
|
|
|
void WINAPIV error_exit(unsigned int id, ...);
|
|
|
|
|
2018-05-21 15:34:50 +02:00
|
|
|
/* regproc.c */
|
|
|
|
void *heap_xalloc(size_t size);
|
|
|
|
void *heap_xrealloc(void *buf, size_t size);
|
|
|
|
char *GetMultiByteString(const WCHAR *strW);
|
|
|
|
BOOL import_registry_file(FILE *reg_file);
|
|
|
|
void delete_registry_key(WCHAR *reg_key_name);
|
|
|
|
BOOL export_registry_key(WCHAR *file_name, WCHAR *path, DWORD format);
|
|
|
|
|
2003-08-07 05:10:13 +02:00
|
|
|
/* treeview.c */
|
2018-05-21 15:35:01 +02:00
|
|
|
HWND CreateTreeView(HWND hwndParent, LPWSTR pHostName, UINT id);
|
|
|
|
BOOL RefreshTreeView(HWND hWndTV);
|
|
|
|
BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEWW* pnmtv);
|
|
|
|
LPWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey);
|
|
|
|
BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem);
|
|
|
|
HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name);
|
|
|
|
HWND StartKeyRename(HWND hwndTV);
|
|
|
|
HTREEITEM FindPathInTree(HWND hwndTV, LPCWSTR lpKeyName);
|
|
|
|
HTREEITEM FindNext(HWND hwndTV, HTREEITEM hItem, LPCWSTR sstring, int mode, int *row);
|
2003-08-07 05:10:13 +02:00
|
|
|
|
|
|
|
#endif /* __MAIN_H__ */
|