disable buggy German resource script for desk.cpl. Remove regedt32 as even Microsoft sees having two registry editors is pointless.

svn path=/trunk/; revision=13779
This commit is contained in:
Steven Edwards 2005-02-28 19:45:54 +00:00
parent db4c78ea86
commit 7faea85017
24 changed files with 2 additions and 2563 deletions

View file

@ -103,7 +103,7 @@ STORAGE_DRIVERS = atapi cdrom class2 disk floppy scsiport diskdump
# System applications
# autochk cmd format services setup usetup welcome winlogon msiexec
SYS_APPS = autochk calc cmd explorer expand format ibrowser msiexec regedt32 regsvr32 \
SYS_APPS = autochk calc cmd explorer expand format ibrowser msiexec regsvr32 \
reporterror services setup taskmgr userinit usetup welcome vmwinst rundll32 \
winlogon regedit winefile notepad reactos lsass

View file

@ -13,5 +13,5 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDC_DESK_ICON ICON "resources/applet.ico"
#include "en.rc"
#include "de.rc"
//#include "de.rc"

View file

@ -1,38 +0,0 @@
PATH_TO_TOP = ../../..
TARGET_TYPE = program
TARGET_APPTYPE = windows
TARGET_NAME = regedt32
TARGET_INSTALLDIR = system32
TARGET_CFLAGS = -DGCC \
-D__USE_W32API \
-D__REACTOS__ \
-D_WIN32_IE=0x600 \
-D_WIN32_WINNT=0x501 \
-DWINVER=0x501
TARGET_RCFLAGS = -DGCC -D_WIN32_IE=0x0400 -D__USE_W32API
TARGET_SDKLIBS = \
kernel32.a \
user32.a \
gdi32.a \
advapi32.a
TARGET_GCCLIBS = comctl32 comdlg32
TARGET_OBJECTS = \
framewnd.o \
childwnd.o \
listview.o \
treeview.o \
settings.o \
main.o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk

View file

@ -1,8 +0,0 @@
// stdafx.cpp : source file that includes just the standard includes
// regedt32.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

View file

@ -1,32 +0,0 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
#include <commctrl.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
// Local Header Files
// TODO: reference additional headers your program requires here
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)

View file

@ -1,285 +0,0 @@
/*
* ReactOS regedt32
*
* childwnd.c
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef _MSC_VER
#include "stdafx.h"
#else
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <commctrl.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <process.h>
#include <stdio.h>
#endif
#include <assert.h>
#define ASSERT assert
#include "main.h"
#include "framewnd.h"
#include "childwnd.h"
#include "treeview.h"
#include "listview.h"
#define COLOR_SPLITBAR LTGRAY_BRUSH
////////////////////////////////////////////////////////////////////////////////
// Global Variables:
//
////////////////////////////////////////////////////////////////////////////////
// Local module support methods
//
static void MakeFullRegPath(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, int max)
{
TVITEM item;
item.mask = TVIF_PARAM;
item.hItem = hItem;
if (TreeView_GetItem(hwndTV, &item)) {
if (item.hItem != TreeView_GetRoot(hwndTV)) {
// recurse
MakeFullRegPath(hwndTV, TreeView_GetParent(hwndTV, hItem), keyPath, pPathLen, max);
keyPath[*pPathLen] = _T('\\');
++(*pPathLen);
}
item.mask = TVIF_TEXT;
item.hItem = hItem;
item.pszText = &keyPath[*pPathLen];
item.cchTextMax = max - *pPathLen;
if (TreeView_GetItem(hwndTV, &item)) {
*pPathLen += _tcslen(item.pszText);
}
}
}
static void draw_splitbar(HWND hWnd, int x)
{
RECT rt;
HDC hdc = GetDC(hWnd);
GetClientRect(hWnd, &rt);
rt.left = x - SPLIT_WIDTH/2;
rt.right = x + SPLIT_WIDTH/2+1;
InvertRect(hdc, &rt);
ReleaseDC(hWnd, hdc);
}
static void ResizeWnd(ChildWnd* pChildWnd, int cx, int cy)
{
HDWP hdwp = BeginDeferWindowPos(2);
RECT rt = {0, 0, cx, cy};
cx = pChildWnd->nSplitPos + SPLIT_WIDTH/2;
DeferWindowPos(hdwp, pChildWnd->hTreeWnd, 0, rt.left, rt.top, pChildWnd->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
// DeferWindowPos(hdwp, pChildWnd->hListWnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
DeferWindowPos(hdwp, pChildWnd->hListWnd, 0, rt.left+cx, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
EndDeferWindowPos(hdwp);
}
static void OnPaint(HWND hWnd, ChildWnd* pChildWnd)
{
HBRUSH lastBrush;
PAINTSTRUCT ps;
RECT rt;
BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rt);
lastBrush = SelectObject(ps.hdc, (HBRUSH)GetStockObject(COLOR_SPLITBAR));
Rectangle(ps.hdc, rt.left, rt.top-1, rt.right, rt.bottom+1);
SelectObject(ps.hdc, lastBrush);
// rt.top = rt.bottom - GetSystemMetrics(SM_CYHSCROLL);
// FillRect(ps.hdc, &rt, GetStockObject(BLACK_BRUSH));
EndPaint(hWnd, &ps);
}
////////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes WM_COMMAND messages for the main frame window.
//
//
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (LOWORD(wParam)) {
// Parse the menu selections:
// case ID_REGISTRY_EXIT:
// DestroyWindow(hWnd);
// break;
default:
return FALSE;
}
return TRUE;
}
////////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: ChildWndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the child windows.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static int last_split;
ChildWnd* pChildWnd = (ChildWnd*)GetWindowLong(hWnd, GWL_USERDATA);
ASSERT(pChildWnd);
switch (message) {
case WM_CREATE:
pChildWnd->nSplitPos = 250;
pChildWnd->hTreeWnd = CreateTreeView(hWnd, pChildWnd->szKeyName, pChildWnd->hKey);
pChildWnd->hListWnd = CreateListView(hWnd/*, &pChildWnd->root*/);
break;
case WM_COMMAND:
if (!_CmdWndProc(hWnd, message, wParam, lParam)) {
goto def;
}
break;
case WM_PAINT:
OnPaint(hWnd, pChildWnd);
return 0;
case WM_SETCURSOR:
if (LOWORD(lParam) == HTCLIENT) {
POINT pt;
GetCursorPos(&pt);
ScreenToClient(hWnd, &pt);
if (pt.x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && pt.x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
SetCursor(LoadCursor(0, IDC_SIZEWE));
return TRUE;
}
}
goto def;
case WM_LBUTTONDOWN: {
RECT rt;
int x = LOWORD(lParam);
GetClientRect(hWnd, &rt);
if (x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
last_split = pChildWnd->nSplitPos;
draw_splitbar(hWnd, last_split);
SetCapture(hWnd);
}
break;}
case WM_LBUTTONUP:
if (GetCapture() == hWnd) {
RECT rt;
int x = LOWORD(lParam);
draw_splitbar(hWnd, last_split);
last_split = -1;
GetClientRect(hWnd, &rt);
pChildWnd->nSplitPos = x;
ResizeWnd(pChildWnd, rt.right, rt.bottom);
ReleaseCapture();
}
break;
case WM_CAPTURECHANGED:
if (GetCapture()==hWnd && last_split>=0)
draw_splitbar(hWnd, last_split);
break;
case WM_KEYDOWN:
if (wParam == VK_ESCAPE)
if (GetCapture() == hWnd) {
RECT rt;
draw_splitbar(hWnd, last_split);
GetClientRect(hWnd, &rt);
ResizeWnd(pChildWnd, rt.right, rt.bottom);
last_split = -1;
ReleaseCapture();
SetCursor(LoadCursor(0, IDC_ARROW));
}
break;
case WM_MOUSEMOVE:
if (GetCapture() == hWnd) {
RECT rt;
int x = LOWORD(lParam);
HDC hdc = GetDC(hWnd);
GetClientRect(hWnd, &rt);
rt.left = last_split-SPLIT_WIDTH/2;
rt.right = last_split+SPLIT_WIDTH/2+1;
InvertRect(hdc, &rt);
last_split = x;
rt.left = x-SPLIT_WIDTH/2;
rt.right = x+SPLIT_WIDTH/2+1;
InvertRect(hdc, &rt);
ReleaseDC(hWnd, hdc);
}
break;
case WM_SETFOCUS:
SetFocus(pChildWnd->nFocusPanel? pChildWnd->hListWnd: pChildWnd->hTreeWnd);
break;
case WM_NOTIFY:
if ((int)wParam == TREE_WINDOW) {
switch (((LPNMHDR)lParam)->code) {
case TVN_ITEMEXPANDING:
return !OnTreeExpanding(pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam);
case TVN_SELCHANGED:
{
HKEY hKey;
TCHAR keyPath[1000];
int keyPathLen = 0;
keyPath[0] = _T('\0');
hKey = FindRegRoot(pChildWnd->hTreeWnd, ((NMTREEVIEW*)lParam)->itemNew.hItem, keyPath, &keyPathLen, sizeof(keyPath));
RefreshListView(pChildWnd->hListWnd, hKey, keyPath);
keyPathLen = 0;
keyPath[0] = _T('\0');
MakeFullRegPath(pChildWnd->hTreeWnd, ((NMTREEVIEW*)lParam)->itemNew.hItem, keyPath, &keyPathLen, sizeof(keyPath));
SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)keyPath);
}
break;
default:
goto def;
}
} else
if ((int)wParam == LIST_WINDOW) {
if (!SendMessage(pChildWnd->hListWnd, message, wParam, lParam)) {
goto def;
}
}
break;
case WM_SIZE:
if (wParam != SIZE_MINIMIZED && pChildWnd != NULL) {
ResizeWnd(pChildWnd, LOWORD(lParam), HIWORD(lParam));
}
// fall through
default: def:
return DefMDIChildProc(hWnd, message, wParam, lParam);
}
return 0;
}

View file

@ -1,42 +0,0 @@
/*
* ReactOS regedt32
*
* childwnd.h
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __CHILDWND_H__
#define __CHILDWND_H__
#ifdef __cplusplus
extern "C" {
#endif
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
#ifdef __cplusplus
};
#endif
#endif // __CHILDWND_H__

View file

@ -1,567 +0,0 @@
/*
* ReactOS regedt32
*
* framewnd.c
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef _MSC_VER
#include "stdafx.h"
#else
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <commctrl.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <process.h>
#include <stdio.h>
#endif
#include <shellapi.h>
#include "main.h"
#include "framewnd.h"
////////////////////////////////////////////////////////////////////////////////
// Global and Local Variables:
//
enum OPTION_FLAGS Options;
BOOL bInMenuLoop = FALSE; // Tells us if we are in the menu loop
static HHOOK hcbthook;
static ChildWnd* newchild = NULL;
////////////////////////////////////////////////////////////////////////////////
// Local module support methods
//
static void resize_frame_rect(HWND hWnd, PRECT prect)
{
RECT rt;
/*
if (IsWindowVisible(hToolBar)) {
SendMessage(hToolBar, WM_SIZE, 0, 0);
GetClientRect(hToolBar, &rt);
prect->top = rt.bottom+3;
prect->bottom -= rt.bottom+3;
}
*/
if (IsWindowVisible(hStatusBar)) {
SetupStatusBar(hWnd, TRUE);
GetClientRect(hStatusBar, &rt);
prect->bottom -= rt.bottom;
}
MoveWindow(hMDIClient, prect->left,prect->top,prect->right,prect->bottom, TRUE);
}
static void resize_frame(HWND hWnd, int cx, int cy)
{
RECT rect = {0, 0, cx, cy};
resize_frame_rect(hWnd, &rect);
}
void resize_frame_client(HWND hWnd)
{
RECT rect;
GetClientRect(hWnd, &rect);
resize_frame_rect(hWnd, &rect);
}
////////////////////////////////////////////////////////////////////////////////
static LRESULT CALLBACK CBTProc(int code, WPARAM wParam, LPARAM lParam)
{
if (code == HCBT_CREATEWND && newchild) {
ChildWnd* pChildWnd = newchild;
newchild = NULL;
pChildWnd->hWnd = (HWND)wParam;
SetWindowLong(pChildWnd->hWnd, GWL_USERDATA, (LPARAM)pChildWnd);
}
return CallNextHookEx(hcbthook, code, wParam, lParam);
}
static ChildWnd* alloc_child_window(LPCTSTR szKeyName, HKEY hKey)
{
ChildWnd* pChildWnd = (ChildWnd*)malloc(sizeof(ChildWnd));
memset(pChildWnd, 0, sizeof(ChildWnd));
pChildWnd->pos.length = sizeof(WINDOWPLACEMENT);
pChildWnd->pos.flags = 0;
pChildWnd->pos.showCmd = SW_SHOWNORMAL;
pChildWnd->pos.rcNormalPosition.left = CW_USEDEFAULT;
pChildWnd->pos.rcNormalPosition.top = CW_USEDEFAULT;
pChildWnd->pos.rcNormalPosition.right = CW_USEDEFAULT;
pChildWnd->pos.rcNormalPosition.bottom = CW_USEDEFAULT;
pChildWnd->nFocusPanel = 0;
pChildWnd->nSplitPos = 300;
// pChildWnd->visible_cols = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES;
// pChildWnd->sortOrder = SORT_NAME;
// pChildWnd->header_wdths_ok = FALSE;
lstrcpy(pChildWnd->szKeyName, szKeyName); // MAX_PATH
pChildWnd->hKey = hKey;
return pChildWnd;
}
static HWND CreateChildWindow(HWND hWnd, LPCTSTR szKeyName, HKEY hKey, int unused)
{
ChildWnd* pChildWnd = alloc_child_window(szKeyName, hKey);
if (pChildWnd != NULL) {
MDICREATESTRUCT mcs = { szChildClass, szKeyName, hInst,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
0/*style*/, (LPARAM)hKey/*lParam*/};
hcbthook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId());
newchild = pChildWnd;
pChildWnd->hWnd = (HWND)SendMessage(hMDIClient, WM_MDICREATE, 0, (LPARAM)&mcs);
UnhookWindowsHookEx(hcbthook);
if (pChildWnd->hWnd != NULL) {
return pChildWnd->hWnd;
} else {
free(pChildWnd);
newchild = pChildWnd = NULL;
}
}
return 0;
}
void CreateClientChildren(HWND hWnd)
{
CreateChildWindow(hWnd, _T("HKEY_CLASSES_ROOT"), HKEY_CLASSES_ROOT, 1);
CreateChildWindow(hWnd, _T("HKEY_CURRENT_USER"), HKEY_CURRENT_USER, 1);
CreateChildWindow(hWnd, _T("HKEY_LOCAL_MACHINE"), HKEY_LOCAL_MACHINE, 1);
CreateChildWindow(hWnd, _T("HKEY_USERS"), HKEY_USERS, 1);
CreateChildWindow(hWnd, _T("HKEY_CURRENT_CONFIG"), HKEY_CURRENT_CONFIG, 1);
PostMessage(hMDIClient, WM_MDICASCADE, 0, 0);
}
static BOOL CALLBACK CloseEnumProc(HWND hWnd, LPARAM lParam)
{
if (!GetWindow(hWnd, GW_OWNER)) {
SendMessage(GetParent(hWnd), WM_MDIRESTORE, (WPARAM)hWnd, 0);
if (SendMessage(hWnd, WM_QUERYENDSESSION, 0, 0)) {
SendMessage(GetParent(hWnd), WM_MDIDESTROY, (WPARAM)hWnd, 0);
}
}
return 1;
}
/*
UINT_PTR CALLBACK CFHookProc(
HWND hdlg, // handle to dialog box
UINT uiMsg, // message identifier
WPARAM wParam, // message parameter
LPARAM lParam // message parameter
);
typedef UINT_PTR (CALLBACK *LPCFHOOKPROC)(HWND, UINT, WPARAM, LPARAM);
typedef struct {
DWORD lStructSize;
HWND hwndOwner;
HDC hDC;
LPLOGFONT lpLogFont;
INT iPointSize;
DWORD Flags;
COLORREF rgbColors;
LPARAM lCustData;
LPCFHOOKPROC lpfnHook;
LPCTSTR lpTemplateName;
HINSTANCE hInstance;
LPTSTR lpszStyle;
WORD nFontType;
WORD ___MISSING_ALIGNMENT__;
INT nSizeMin;
INT nSizeMax;
} CHOOSEFONT, *LPCHOOSEFONT;
*/
static void CmdOptionsFont(HWND hWnd)
{
// LOGFONT LogFont;
CHOOSEFONT cf = { sizeof(CHOOSEFONT), hWnd, NULL,
// &LogFont, // lpLogFont
NULL, // lpLogFont
0, // iPointSize
// CF_INITTOLOGFONTSTRUCT, // Flags
CF_SCREENFONTS, // Flags
0, // rgbColors;
0L, // lCustData;
NULL, // lpfnHook;
NULL, // lpTemplateName;
hInst, // hInstance;
NULL, // lpszStyle;
0, // nFontType;
0, // ___MISSING_ALIGNMENT__;
0, // nSizeMin;
0 // nSizeMax
};
if (ChooseFont(&cf)) {
} else {
TCHAR* errStr = NULL;
DWORD error = CommDlgExtendedError();
switch (error) {
case CDERR_DIALOGFAILURE: errStr = _T("The dialog box could not be created. The common dialog box function's call to the DialogBox function failed. For example, this error occurs if the common dialog box call specifies an invalid window handle."); break;
case CDERR_FINDRESFAILURE: errStr = _T("The common dialog box function failed to find a specified resource."); break;
case CDERR_INITIALIZATION: errStr = _T("The common dialog box function failed during initialization. This error often occurs when sufficient memory is not available."); break;
case CDERR_LOADRESFAILURE: errStr = _T("The common dialog box function failed to load a specified resource."); break;
case CDERR_LOADSTRFAILURE: errStr = _T("The common dialog box function failed to load a specified string."); break;
case CDERR_LOCKRESFAILURE: errStr = _T("The common dialog box function failed to lock a specified resource."); break;
case CDERR_MEMALLOCFAILURE: errStr = _T("The common dialog box function was unable to allocate memory for internal structures."); break;
case CDERR_MEMLOCKFAILURE: errStr = _T("The common dialog box function was unable to lock the memory associated with a handle."); break;
case CDERR_NOHINSTANCE: errStr = _T("The ENABLETEMPLATE flag was set in the Flags member of the initialization structure for the corresponding common dialog box, but you failed to provide a corresponding instance handle."); break;
case CDERR_NOHOOK: errStr = _T("The ENABLEHOOK flag was set in the Flags member of the initialization structure for the corresponding common dialog box, but you failed to provide a pointer to a corresponding hook procedure."); break;
case CDERR_NOTEMPLATE: errStr = _T("The ENABLETEMPLATE flag was set in the Flags member of the initialization structure for the corresponding common dialog box, but you failed to provide a corresponding template."); break;
case CDERR_REGISTERMSGFAIL: errStr = _T("The RegisterWindowMessage function returned an error code when it was called by the common dialog box function."); break;
case CDERR_STRUCTSIZE: errStr = _T("The lStructSize member of the initialization structure for the corresponding common dialog box is invalid."); break;
case CFERR_MAXLESSTHANMIN:
break;
case CFERR_NOFONTS:
break;
}
if (errStr) {
MessageBox(hWnd, errStr, szTitle, MB_ICONERROR | MB_OK);
}
}
}
static void CmdRegistryPrint(HWND hWnd, int cmd)
{
PRINTDLG pd = { sizeof(PRINTDLG), hWnd,
0, // hDevMode;
0, // hDevNames;
NULL, // hDC;
0L, // Flags;
0, // nFromPage;
0, // nToPage;
0, // nMinPage;
0, // nMaxPage;
0, // nCopies;
NULL, // hInstance;
0, // lCustData;
NULL, // lpfnPrintHook;
NULL, // lpfnSetupHook;
NULL, // lpPrintTemplateName;
NULL, // lpSetupTemplateName;
0, // hPrintTemplate;
0 // hSetupTemplate;
};
switch (cmd) {
case ID_REGISTRY_PRINTSUBTREE:
PrintDlg(&pd);
break;
case ID_REGISTRY_PRINTERSETUP:
PrintDlg(&pd);
break;
}
//PAGESETUPDLG psd;
//PageSetupDlg(&psd);
}
/*
typedef struct tagOFN {
DWORD lStructSize;
HWND hwndOwner;
HINSTANCE hInstance;
LPCTSTR lpstrFilter;
LPTSTR lpstrCustomFilter;
DWORD nMaxCustFilter;
DWORD nFilterIndex;
LPTSTR lpstrFile;
DWORD nMaxFile;
LPTSTR lpstrFileTitle;
DWORD nMaxFileTitle;
LPCTSTR lpstrInitialDir;
LPCTSTR lpstrTitle;
DWORD Flags;
WORD nFileOffset;
WORD nFileExtension;
LPCTSTR lpstrDefExt;
LPARAM lCustData;
LPOFNHOOKPROC lpfnHook;
LPCTSTR lpTemplateName;
#if (_WIN32_WINNT >= 0x0500)
void * pvReserved;
DWORD dwReserved;
DWORD FlagsEx;
#endif // (_WIN32_WINNT >= 0x0500)
} OPENFILENAME, *LPOPENFILENAME;
*/
//GetOpenFileName(...);
//GetSaveFileName(...);
static void CmdRegistrySaveSubTreeAs(HWND hWnd)
{
OPENFILENAME ofn;// = { };
memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hWnd;
if (GetSaveFileName(&ofn)) {
} else {
}
}
void SetupStatusBar(HWND hWnd, BOOL bResize)
{
RECT rc;
int nParts;
GetClientRect(hWnd, &rc);
nParts = rc.right;
// nParts = -1;
if (bResize)
SendMessage(hStatusBar, WM_SIZE, 0, 0);
SendMessage(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
}
void UpdateStatusBar(void)
{
TCHAR text[260];
DWORD size;
size = sizeof(text)/sizeof(TCHAR);
GetComputerName(text, &size);
SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)text);
}
static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
{
BOOL vis = IsWindowVisible(hchild);
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), cmd, vis?MF_BYCOMMAND:MF_BYCOMMAND|MF_CHECKED);
ShowWindow(hchild, vis?SW_HIDE:SW_SHOW);
resize_frame_client(hWnd);
}
////////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes WM_COMMAND messages for the main frame window.
//
//
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND hChildWnd;
switch (LOWORD(wParam)) {
case ID_WINDOW_CLOSEALL:
EnumChildWindows(hMDIClient, &CloseEnumProc, 0);
break;
case ID_WINDOW_CLOSE:
hChildWnd = (HWND) SendMessage(hMDIClient, WM_MDIGETACTIVE, 0, 0);
if (!SendMessage(hChildWnd, WM_QUERYENDSESSION, 0, 0))
SendMessage(hMDIClient, WM_MDIDESTROY, (WPARAM)hChildWnd, 0);
break;
case ID_REGISTRY_OPENLOCAL:
CreateClientChildren(hWnd);
break;
case ID_REGISTRY_CLOSE:
SendMessage(hWnd, WM_COMMAND, ID_WINDOW_CLOSEALL, 0);
// SendMessage(hWnd, WM_CLOSE, 0, 0);
break;
case ID_REGISTRY_LOADHIVE:
case ID_REGISTRY_UNLOADHIVE:
case ID_REGISTRY_RESTORE:
case ID_REGISTRY_SAVEKEY:
case ID_REGISTRY_SELECTCOMPUTER:
break;
case ID_REGISTRY_PRINTSUBTREE:
case ID_REGISTRY_PRINTERSETUP:
CmdRegistryPrint(hWnd, LOWORD(wParam));
break;
case ID_REGISTRY_SAVESUBTREEAS:
CmdRegistrySaveSubTreeAs(hWnd);
break;
case ID_REGISTRY_EXIT:
DestroyWindow(hWnd);
break;
case ID_OPTIONS_FONT:
CmdOptionsFont(hWnd);
break;
case ID_VIEW_STATUSBAR:
toggle_child(hWnd, LOWORD(wParam), hStatusBar);
break;
case ID_VIEW_DISPLAYBINARYDATA:
if (Options & OPTIONS_DISPLAY_BINARY_DATA) {
Options &= ~OPTIONS_DISPLAY_BINARY_DATA;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), LOWORD(wParam), MF_BYCOMMAND);
} else {
Options |= OPTIONS_DISPLAY_BINARY_DATA;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), LOWORD(wParam), MF_BYCOMMAND | MF_CHECKED);
}
break;
////
case ID_VIEW_TREEANDDATA:
Options &= ~(OPTIONS_VIEW_TREE_ONLY|OPTIONS_VIEW_DATA_ONLY);
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), LOWORD(wParam), MF_BYCOMMAND | MF_CHECKED);
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_TREEONLY, MF_BYCOMMAND);
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_DATAONLY, MF_BYCOMMAND);
break;
case ID_VIEW_TREEONLY:
Options &= ~OPTIONS_VIEW_DATA_ONLY;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), LOWORD(wParam), MF_BYCOMMAND | MF_CHECKED);
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_TREEANDDATA, MF_BYCOMMAND);
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_DATAONLY, MF_BYCOMMAND);
break;
case ID_VIEW_DATAONLY:
Options &= ~OPTIONS_VIEW_TREE_ONLY;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), LOWORD(wParam), MF_BYCOMMAND | MF_CHECKED);
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_TREEANDDATA, MF_BYCOMMAND);
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_TREEONLY, MF_BYCOMMAND);
break;
////
case ID_OPTIONS_AUTOREFRESH:
if (Options & OPTIONS_AUTO_REFRESH) {
Options &= ~OPTIONS_AUTO_REFRESH;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), LOWORD(wParam), MF_BYCOMMAND);
} else {
Options |= OPTIONS_AUTO_REFRESH;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), LOWORD(wParam), MF_BYCOMMAND | MF_CHECKED);
}
break;
case ID_OPTIONS_READONLYMODE:
if (Options & OPTIONS_READ_ONLY_MODE) {
Options &= ~OPTIONS_READ_ONLY_MODE;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), LOWORD(wParam), MF_BYCOMMAND);
} else {
Options |= OPTIONS_READ_ONLY_MODE;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), LOWORD(wParam), MF_BYCOMMAND | MF_CHECKED);
}
break;
case ID_OPTIONS_CONFIRMONDELETE:
if (Options & OPTIONS_CONFIRM_ON_DELETE) {
Options &= ~OPTIONS_CONFIRM_ON_DELETE;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), LOWORD(wParam), MF_BYCOMMAND);
} else {
Options |= OPTIONS_CONFIRM_ON_DELETE;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), LOWORD(wParam), MF_BYCOMMAND | MF_CHECKED);
}
break;
case ID_OPTIONS_SAVESETTINGSONEXIT:
if (Options & OPTIONS_SAVE_ON_EXIT) {
Options &= ~OPTIONS_SAVE_ON_EXIT;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), LOWORD(wParam), MF_BYCOMMAND);
} else {
Options |= OPTIONS_SAVE_ON_EXIT;
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), LOWORD(wParam), MF_BYCOMMAND | MF_CHECKED);
}
break;
case ID_WINDOW_CASCADE:
SendMessage(hMDIClient, WM_MDICASCADE, 0, 0);
break;
case ID_WINDOW_TILE_HORZ:
SendMessage(hMDIClient, WM_MDITILE, MDITILE_HORIZONTAL, 0);
break;
case ID_WINDOW_TILE_VERT:
SendMessage(hMDIClient, WM_MDITILE, MDITILE_VERTICAL, 0);
break;
case ID_WINDOW_ARRANGEICONS:
SendMessage(hMDIClient, WM_MDIICONARRANGE, 0, 0);
break;
case ID_HELP_ABOUT:
// ShowAboutBox(hWnd);
{
HICON hIcon = LoadIcon(hInst, (LPCTSTR)IDI_REGEDT32);
ShellAbout(hWnd, szTitle, "FrameWndProc", hIcon);
//if (hIcon) DestroyIcon(hIcon); // NOT REQUIRED
}
break;
default:
return FALSE;
}
return TRUE;
}
////////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: FrameWndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main frame window.
//
// WM_COMMAND - process the application menu
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case WM_CREATE:
{
HMENU hMenuWindow = GetSubMenu(hMenuFrame, GetMenuItemCount(hMenuFrame)-2);
CLIENTCREATESTRUCT ccs = { hMenuWindow, IDW_FIRST_CHILD };
hMDIClient = CreateWindowEx(0, _T("MDICLIENT"), NULL,
WS_EX_MDICHILD|WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE,
0, 0, 0, 0,
hWnd, (HMENU)0, hInst, &ccs);
}
if (Options & OPTIONS_AUTO_REFRESH) {
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), ID_OPTIONS_AUTOREFRESH, MF_BYCOMMAND | MF_CHECKED);
}
if (Options & OPTIONS_READ_ONLY_MODE) {
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), ID_OPTIONS_READONLYMODE, MF_BYCOMMAND | MF_CHECKED);
}
if (Options & OPTIONS_CONFIRM_ON_DELETE) {
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), ID_OPTIONS_CONFIRMONDELETE, MF_BYCOMMAND | MF_CHECKED);
}
if (Options & OPTIONS_SAVE_ON_EXIT) {
CheckMenuItem(GetSubMenu(hMenuFrame, ID_OPTIONS_MENU), ID_OPTIONS_SAVESETTINGSONEXIT, MF_BYCOMMAND | MF_CHECKED);
}
CreateClientChildren(hWnd);
break;
case WM_COMMAND:
if (!_CmdWndProc(hWnd, message, wParam, lParam)) {
// HWND hChildWnd = (HWND)SendMessage(hMDIClient, WM_MDIGETACTIVE, 0, 0);
// if (IsWindow(hChildWnd))
// if (SendMessage(hChildWnd, WM_DISPATCH_COMMAND, wParam, lParam))
// break;
return DefFrameProc(hWnd, hMDIClient, message, wParam, lParam);
}
break;
case WM_SIZE:
resize_frame_client(hWnd);
break;
case WM_DESTROY:
WinHelp(hWnd, _T("regedt32"), HELP_QUIT, 0);
PostQuitMessage(0);
break;
case WM_QUERYENDSESSION:
case WM_CLOSE:
SendMessage(hWnd, WM_COMMAND, ID_WINDOW_CLOSEALL, 0);
if (GetWindow(hMDIClient, GW_CHILD) != NULL)
return 0;
// else fall thru...
default:
return DefFrameProc(hWnd, hMDIClient, message, wParam, lParam);
}
return 0;
}

View file

@ -1,46 +0,0 @@
/*
* ReactOS regedt32
*
* framewnd.h
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __FRAMEWND_H__
#define __FRAMEWND_H__
#ifdef __cplusplus
extern "C" {
#endif
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
void CreateClientChildren(HWND hWnd);
void SetupStatusBar(HWND hWnd, BOOL bResize);
void UpdateStatusBar(void);
#ifdef __cplusplus
};
#endif
#endif // __FRAMEWND_H__

View file

@ -1,363 +0,0 @@
/*
* ReactOS regedit
*
* listview.c
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef _MSC_VER
#include "stdafx.h"
#else
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <commctrl.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <process.h>
#include <stdio.h>
#endif
#include <windowsx.h>
#include "main.h"
#include "listview.h"
////////////////////////////////////////////////////////////////////////////////
// Global and Local Variables:
//
static WNDPROC g_orgListWndProc;
#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
static int default_column_widths[MAX_LIST_COLUMNS] = { 200, 175, 400 };
static int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT };
////////////////////////////////////////////////////////////////////////////////
// Local module support methods
//
static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValBuf, DWORD dwCount)
{
LVITEM item;
item.mask = LVIF_TEXT | LVIF_PARAM;
item.iItem = 0;//idx;
item.iSubItem = 0;
item.state = 0;
item.stateMask = 0;
item.pszText = Name;
item.cchTextMax = _tcslen(item.pszText);
item.iImage = 0;
item.lParam = (LPARAM)dwValType;
// item.lParam = (LPARAM)ValBuf;
#if (_WIN32_IE >= 0x0300)
item.iIndent = 0;
#endif
ListView_InsertItem(hwndLV, &item);
}
static void CreateListColumns(HWND hWndListView)
{
TCHAR szText[50];
int index;
LV_COLUMN lvC;
// Create columns.
lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvC.pszText = szText;
// Load the column labels from the resource file.
for (index = 0; index < MAX_LIST_COLUMNS; index++) {
lvC.iSubItem = index;
lvC.cx = default_column_widths[index];
lvC.fmt = column_alignment[index];
LoadString(hInst, IDS_LIST_COLUMN_FIRST + index, szText, sizeof(szText)/sizeof(TCHAR));
if (ListView_InsertColumn(hWndListView, index, &lvC) == -1) {
// TODO: handle failure condition...
break;
}
}
}
// OnGetDispInfo - processes the LVN_GETDISPINFO notification message.
static void OnGetDispInfo(NMLVDISPINFO* plvdi)
{
static TCHAR buffer[200];
plvdi->item.pszText = NULL;
plvdi->item.cchTextMax = 0;
switch (plvdi->item.iSubItem) {
case 0:
plvdi->item.pszText = _T("(Default)");
break;
case 1:
switch (plvdi->item.lParam) {
case REG_SZ:
plvdi->item.pszText = _T("REG_SZ");
break;
case REG_EXPAND_SZ:
plvdi->item.pszText = _T("REG_EXPAND_SZ");
break;
case REG_BINARY:
plvdi->item.pszText = _T("REG_BINARY");
break;
case REG_DWORD:
plvdi->item.pszText = _T("REG_DWORD");
break;
// case REG_DWORD_LITTLE_ENDIAN:
// plvdi->item.pszText = _T("REG_DWORD_LITTLE_ENDIAN");
// break;
case REG_DWORD_BIG_ENDIAN:
plvdi->item.pszText = _T("REG_DWORD_BIG_ENDIAN");
break;
case REG_MULTI_SZ:
plvdi->item.pszText = _T("REG_MULTI_SZ");
break;
case REG_LINK:
plvdi->item.pszText = _T("REG_LINK");
break;
case REG_RESOURCE_LIST:
plvdi->item.pszText = _T("REG_RESOURCE_LIST");
break;
case REG_NONE:
plvdi->item.pszText = _T("REG_NONE");
break;
default:
wsprintf(buffer, _T("unknown(%d)"), plvdi->item.lParam);
plvdi->item.pszText = buffer;
break;
}
break;
case 2:
plvdi->item.pszText = _T("(value not set)");
break;
case 3:
plvdi->item.pszText = _T("");
break;
}
}
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
TCHAR buf1[1000];
TCHAR buf2[1000];
ListView_GetItemText((HWND)lParamSort, lParam1, 0, buf1, sizeof(buf1));
ListView_GetItemText((HWND)lParamSort, lParam2, 0, buf2, sizeof(buf2));
return _tcscmp(buf1, buf2);
}
static void ListViewPopUpMenu(HWND hWnd, POINT pt)
{
}
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (LOWORD(wParam)) {
// case ID_FILE_OPEN:
// break;
default:
return FALSE;
}
return TRUE;
}
static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case WM_COMMAND:
if (!_CmdWndProc(hWnd, message, wParam, lParam)) {
return CallWindowProc(g_orgListWndProc, hWnd, message, wParam, lParam);
}
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case LVN_GETDISPINFO:
OnGetDispInfo((NMLVDISPINFO*)lParam);
break;
case NM_DBLCLK:
{
NMITEMACTIVATE* nmitem = (LPNMITEMACTIVATE)lParam;
LVHITTESTINFO info;
if (nmitem->hdr.hwndFrom != hWnd) break;
// if (nmitem->hdr.idFrom != IDW_LISTVIEW) break;
// if (nmitem->hdr.code != ???) break;
#ifdef _MSC_VER
switch (nmitem->uKeyFlags) {
case LVKF_ALT: // The ALT key is pressed.
// properties dialog box ?
break;
case LVKF_CONTROL: // The CTRL key is pressed.
// run dialog box for providing parameters...
break;
case LVKF_SHIFT: // The SHIFT key is pressed.
break;
}
#endif
info.pt.x = nmitem->ptAction.x;
info.pt.y = nmitem->ptAction.y;
if (ListView_HitTest(hWnd, &info) != -1) {
LVITEM item;
item.mask = LVIF_PARAM;
item.iItem = info.iItem;
if (ListView_GetItem(hWnd, &item)) {
}
}
}
break;
case NM_RCLICK:
{
int idx;
LV_HITTESTINFO lvH;
NM_LISTVIEW* pNm = (NM_LISTVIEW*)lParam;
lvH.pt.x = pNm->ptAction.x;
lvH.pt.y = pNm->ptAction.y;
idx = ListView_HitTest(hWnd, &lvH);
if (idx != -1) {
POINT pt;
GetCursorPos(&pt);
ListViewPopUpMenu(hWnd, pt);
return idx;
}
}
break;
default:
return CallWindowProc(g_orgListWndProc, hWnd, message, wParam, lParam);
}
break;
case WM_KEYDOWN:
if (wParam == VK_TAB) {
//TODO: SetFocus(Globals.hDriveBar)
//SetFocus(child->nFocusPanel? child->left.hWnd: child->right.hWnd);
}
// fall thru...
default:
return CallWindowProc(g_orgListWndProc, hWnd, message, wParam, lParam);
break;
}
return 0;
}
HWND CreateListView(HWND hwndParent)
{
RECT rcClient;
HWND hwndLV;
// Get the dimensions of the parent window's client area, and create the list view control.
GetClientRect(hwndParent, &rcClient);
hwndLV = CreateWindowEx(0, WC_LISTVIEW, _T("List View"),
WS_VISIBLE | WS_CHILD | WS_EX_CLIENTEDGE | LVS_REPORT,
0, 0, rcClient.right, rcClient.bottom,
hwndParent, (HMENU)LIST_WINDOW, hInst, NULL);
ListView_SetExtendedListViewStyle(hwndLV, LVS_EX_FULLROWSELECT);
// Initialize the image list, and add items to the control.
/*
if (!InitListViewImageLists(hwndLV) ||
!InitListViewItems(hwndLV, szName)) {
DestroyWindow(hwndLV);
return FALSE;
}
*/
CreateListColumns(hwndLV);
g_orgListWndProc = SubclassWindow(hwndLV, ListWndProc);
return hwndLV;
}
BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPTSTR keyPath)
{
if (hwndLV != NULL) {
ListView_DeleteAllItems(hwndLV);
}
if (hKey != NULL) {
LONG errCode;
HKEY hNewKey;
DWORD max_sub_key_len;
DWORD max_val_name_len;
DWORD max_val_size;
DWORD val_count;
errCode = RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL,
&max_sub_key_len, NULL, &val_count, &max_val_name_len, &max_val_size, NULL, NULL);
if (errCode == ERROR_SUCCESS) {
TCHAR* ValName = malloc(++max_val_name_len * sizeof(TCHAR));
DWORD dwValNameLen = max_val_name_len;
BYTE* ValBuf = malloc(++max_val_size);
DWORD dwValSize = max_val_size;
DWORD dwIndex = 0L;
DWORD dwValType;
while (RegEnumValue(hKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS) {
AddEntryToList(hwndLV, ValName, dwValType, ValBuf, dwIndex);
dwValNameLen = max_val_name_len;
dwValSize = max_val_size;
dwValType = 0L;
++dwIndex;
}
free(ValBuf);
free(ValName);
}
errCode = RegOpenKeyEx(hKey, keyPath, 0, KEY_READ, &hNewKey);
if (errCode == ERROR_SUCCESS) {
DWORD max_sub_key_len;
DWORD max_val_name_len;
DWORD max_val_size;
DWORD val_count;
ShowWindow(hwndLV, SW_HIDE);
/* get size information and resize the buffers if necessary */
errCode = RegQueryInfoKey(hNewKey, NULL, NULL, NULL, NULL,
&max_sub_key_len, NULL, &val_count, &max_val_name_len, &max_val_size, NULL, NULL);
if (errCode == ERROR_SUCCESS) {
TCHAR* ValName = malloc(++max_val_name_len * sizeof(TCHAR));
DWORD dwValNameLen = max_val_name_len;
BYTE* ValBuf = malloc(++max_val_size);
DWORD dwValSize = max_val_size;
DWORD dwIndex = 0L;
DWORD dwValType;
while (RegEnumValue(hNewKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS) {
//while (RegEnumValue(hNewKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, NULL, NULL) == ERROR_SUCCESS) {
AddEntryToList(hwndLV, ValName, dwValType, ValBuf, dwIndex);
dwValNameLen = max_val_name_len;
dwValSize = max_val_size;
dwValType = 0L;
++dwIndex;
}
free(ValBuf);
free(ValName);
}
//ListView_SortItemsEx(hwndLV, CompareFunc, hwndLV);
// SendMessage(hwndLV, LVM_SORTITEMSEX, (WPARAM)CompareFunc, (LPARAM)hwndLV);
ShowWindow(hwndLV, SW_SHOW);
RegCloseKey(hNewKey);
}
}
return TRUE;
}

View file

@ -1,43 +0,0 @@
/*
* ReactOS regedit
*
* listview.h
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __LISTVIEW_H__
#define __LISTVIEW_H__
#ifdef __cplusplus
extern "C" {
#endif
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
HWND CreateListView(HWND hwndParent);
BOOL RefreshListView(HWND hwndTV, HKEY hKey, LPTSTR keyPath);
#ifdef __cplusplus
};
#endif
#endif // __LISTVIEW_H__

View file

@ -1,181 +0,0 @@
/*
* ReactOS regedt32
*
* main.c
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef _MSC_VER
#include "stdafx.h"
#else
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <commctrl.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <process.h>
#include <stdio.h>
#endif
#include "main.h"
#include "framewnd.h"
#include "childwnd.h"
#include "settings.h"
////////////////////////////////////////////////////////////////////////////////
// Global Variables:
//
HINSTANCE hInst;
HACCEL hAccel;
HWND hFrameWnd;
HWND hMDIClient;
HWND hStatusBar;
HMENU hMenuFrame;
TCHAR szTitle[MAX_LOADSTRING];
TCHAR szFrameClass[MAX_LOADSTRING];
TCHAR szChildClass[MAX_LOADSTRING];
////////////////////////////////////////////////////////////////////////////////
//
//
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
WNDCLASSEX wcFrame = {
sizeof(WNDCLASSEX),
CS_HREDRAW | CS_VREDRAW/*style*/,
FrameWndProc,
0/*cbClsExtra*/,
0/*cbWndExtra*/,
hInstance,
LoadIcon(hInstance, MAKEINTRESOURCE(IDI_REGEDT32)),
LoadCursor(0, IDC_ARROW),
0/*hbrBackground*/,
0/*lpszMenuName*/,
szFrameClass,
(HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDT32), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED)
};
ATOM hFrameWndClass = RegisterClassEx(&wcFrame); // register frame window class
WNDCLASSEX wcChild = {
sizeof(WNDCLASSEX),
CS_HREDRAW | CS_VREDRAW | CS_NOCLOSE/*style*/,
ChildWndProc,
0/*cbClsExtra*/,
sizeof(HANDLE)/*cbWndExtra*/,
hInstance,
LoadIcon(hInstance, MAKEINTRESOURCE(IDI_REGEDT32)),
LoadCursor(0, IDC_ARROW),
0/*hbrBackground*/,
0/*lpszMenuName*/,
szChildClass,
(HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDT32), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED)
};
ATOM hChildWndClass = RegisterClassEx(&wcChild); // register child windows class
hMenuFrame = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_REGEDT32_MENU));
// hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_REGEDT32));
// Initialize the Windows Common Controls DLL
InitCommonControls();
hFrameWnd = CreateWindowEx(0, (LPCTSTR)(int)hFrameWndClass, szTitle,
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, hMenuFrame, hInstance, NULL/*lpParam*/);
if (!hFrameWnd) {
return FALSE;
}
// Create the status bar
hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS,
_T(""), hFrameWnd, STATUS_WINDOW);
if (hStatusBar) {
// Create the status bar panes
SetupStatusBar(hFrameWnd, FALSE);
CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
}
ShowWindow(hFrameWnd, nCmdShow);
UpdateWindow(hFrameWnd);
return TRUE;
}
////////////////////////////////////////////////////////////////////////////////
void ExitInstance(void)
{
DestroyMenu(hMenuFrame);
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
// HACCEL hAccel;
HWND hMDIClient;
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_REGEDT32_FRAME, szFrameClass, MAX_LOADSTRING);
LoadString(hInstance, IDC_REGEDT32, szChildClass, MAX_LOADSTRING);
// Store instance handle in our global variable
hInst = hInstance;
// Load our settings from the registry
LoadSettings();
// Perform application initialization:
if (!InitInstance(hInstance, nCmdShow)) {
return FALSE;
}
// hAccel = LoadAccelerators(hInstance, (LPCTSTR)IDC_REGEDT32);
hMDIClient = GetWindow(hFrameWnd, GW_CHILD);
// Main message loop:
while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
if (!TranslateMDISysAccel(hMDIClient, &msg) &&
!TranslateAccelerator(hFrameWnd, hAccel, &msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
// Save our settings to the registry
SaveSettings();
ExitInstance();
return msg.wParam;
}

View file

@ -1,111 +0,0 @@
/*
* ReactOS regedt32
*
* main.h
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __MAIN_H__
#define __MAIN_H__
#ifdef __cplusplus
extern "C" {
#endif
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "resource.h"
#define STATUS_WINDOW 2001
#define TREE_WINDOW 2002
#define LIST_WINDOW 2003
#define MAX_LOADSTRING 100
#define SPLIT_WIDTH 5
#define MAX_NAME_LEN 500
#define ID_WINDOW_CLOSE 798
#define ID_WINDOW_CLOSEALL 799
#define IDW_FIRST_CHILD 0xC000 //0x200
////////////////////////////////////////////////////////////////////////////////
enum OPTION_FLAGS {
OPTIONS_AUTO_REFRESH = 0x01,
OPTIONS_READ_ONLY_MODE = 0x02,
OPTIONS_CONFIRM_ON_DELETE = 0x04,
OPTIONS_SAVE_ON_EXIT = 0x08,
OPTIONS_DISPLAY_BINARY_DATA = 0x10,
OPTIONS_VIEW_TREE_ONLY = 0x20,
OPTIONS_VIEW_DATA_ONLY = 0x40,
};
typedef struct {
HWND hWnd;
HWND hTreeWnd;
HWND hListWnd;
int nFocusPanel; // 0: left 1: right
int nSplitPos;
WINDOWPLACEMENT pos;
TCHAR szKeyName[MAX_PATH];
HKEY hKey;
} ChildWnd;
////////////////////////////////////////////////////////////////////////////////
// Global Variables:
//
extern HINSTANCE hInst;
extern HACCEL hAccel;
extern HWND hFrameWnd;
extern HMENU hMenuFrame;
extern HWND hMDIClient;
extern HWND hStatusBar;
//extern HWND hToolBar;
extern HFONT hFont;
extern enum OPTION_FLAGS Options;
extern TCHAR szTitle[];
extern TCHAR szFrameClass[];
extern TCHAR szChildClass[];
#if __MINGW32_MAJOR_VERSION == 1
/*
typedef struct tagNMITEMACTIVATE{
NMHDR hdr;
int iItem;
int iSubItem;
UINT uNewState;
UINT uOldState;
UINT uChanged;
POINT ptAction;
LPARAM lParam;
UINT uKeyFlags;
} NMITEMACTIVATE, FAR *LPNMITEMACTIVATE;
*/
#endif
#ifdef __cplusplus
};
#endif
#endif // __MAIN_H__

View file

@ -1,261 +0,0 @@
/* $Id$ */
#include <reactos/resource.h>
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Registry Editor 32 by Robert Dickenson\0"
#define REACTOS_STR_INTERNAL_NAME "regedt32\0"
#define REACTOS_STR_ORIGINAL_FILENAME "regedt32.exe\0"
#include <reactos/version.rc>
//Microsoft Developer Studio generated resource script.
//
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_REGEDT32 ICON DISCARDABLE "res/regedt32.ico"
IDI_SMALL ICON DISCARDABLE "res/small.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_OPEN_FILE BITMAP DISCARDABLE "res/folder3.bmp"
IDB_CLOSED_FILE BITMAP DISCARDABLE "res/folder1.bmp"
IDB_ROOT BITMAP DISCARDABLE "res/folder2.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_REGEDT32_MENU MENU DISCARDABLE
BEGIN
POPUP "&Registry"
BEGIN
MENUITEM "&Open Local", ID_REGISTRY_OPENLOCAL
MENUITEM "&Close", ID_REGISTRY_CLOSE
MENUITEM SEPARATOR
MENUITEM "&Load Hive", ID_REGISTRY_LOADHIVE, GRAYED
MENUITEM "&Unload Hive", ID_REGISTRY_UNLOADHIVE
, GRAYED
MENUITEM "R&estore...", ID_REGISTRY_RESTORE, GRAYED
MENUITEM "Sa&ve Key...", ID_REGISTRY_SAVEKEY, GRAYED
MENUITEM SEPARATOR
MENUITEM "&Select Computer...", ID_REGISTRY_SELECTCOMPUTER, GRAYED
MENUITEM SEPARATOR
MENUITEM "&Print Subtree", ID_REGISTRY_PRINTSUBTREE
MENUITEM "P&rinter Setup...", ID_REGISTRY_PRINTERSETUP
MENUITEM "Save Subtree &As...", ID_REGISTRY_SAVESUBTREEAS
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_REGISTRY_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "Add &Key...", ID_EDIT_ADDKEY, GRAYED
MENUITEM "Add &Value...", ID_EDIT_ADDVALUE, GRAYED
MENUITEM "&Delete\tDel", ID_EDIT_DELETE, GRAYED
MENUITEM SEPARATOR
MENUITEM "&Binary...", ID_EDIT_BINARY, GRAYED
MENUITEM "&String...", ID_EDIT_STRING, GRAYED
MENUITEM "D&WORD...", ID_EDIT_DWORD, GRAYED
MENUITEM "&Multi String...", ID_EDIT_MULTISTRING, GRAYED
END
POPUP "&Tree"
BEGIN
MENUITEM "E&xpand One Level\t+", ID_TREE_EXPANDONELEVEL
, GRAYED
MENUITEM "Expand Branch\t*", ID_TREE_EXPANDBRANCH, GRAYED
MENUITEM "Expand &All\tCtrl+*", ID_TREE_EXPANDALL, GRAYED
MENUITEM "&Collapse Branch\t-", ID_TREE_COLLAPSEBRANCH
, GRAYED
END
POPUP "&View"
BEGIN
MENUITEM "Tree &and Data", ID_VIEW_TREEANDDATA, CHECKED
MENUITEM "&Tree only", ID_VIEW_TREEONLY
MENUITEM "&Data only", ID_VIEW_DATAONLY
MENUITEM SEPARATOR
MENUITEM "Status &Bar", ID_VIEW_STATUSBAR
MENUITEM "&Split", ID_VIEW_SPLIT, GRAYED
MENUITEM SEPARATOR
MENUITEM "Display &Binary Data", ID_VIEW_DISPLAYBINARYDATA
MENUITEM SEPARATOR
MENUITEM "R&efresh All\tShift+F6", ID_VIEW_REFRESHALL, GRAYED
MENUITEM "&Refresh Active\tF6", ID_VIEW_REFRESHACTIVE
, GRAYED
MENUITEM SEPARATOR
MENUITEM "&Find Key...", ID_VIEW_FINDKEY, GRAYED
END
POPUP "Security"
BEGIN
MENUITEM "&Permissions...", ID_SECURITY_PERMISSIONS
, GRAYED
END
POPUP "&Options"
BEGIN
MENUITEM "&Font...", ID_OPTIONS_FONT
MENUITEM SEPARATOR
MENUITEM "&Auto Refresh", ID_OPTIONS_AUTOREFRESH
MENUITEM "&Read Only Mode", ID_OPTIONS_READONLYMODE
MENUITEM "&Confirm on Delete", ID_OPTIONS_CONFIRMONDELETE
MENUITEM "&Save Settings on Exit", ID_OPTIONS_SAVESETTINGSONEXIT
END
POPUP "&Window"
BEGIN
MENUITEM "&Cascade\tShift+F5", ID_WINDOW_CASCADE
MENUITEM "&Tile\tShift+F4", ID_WINDOW_TILE
MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGEICONS
END
POPUP "&Help"
BEGIN
MENUITEM "&Contents", ID_HELP_CONTENTS
MENUITEM SEPARATOR
MENUITEM "&About Registry Editor...", ID_HELP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 22, 17, 230, 75
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "About"
FONT 8, "System"
BEGIN
ICON IDI_REGEDT32,IDI_REGEDT32,14,9,16,16
LTEXT "ReactOS regedt32 Version 1.0",IDC_STATIC,49,10,119,8,
SS_NOPREFIX
LTEXT "Copyright (C) 2002 ReactOS Team",IDC_STATIC,49,20,119,8
DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""resource.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_LIST_COLUMN_NAME "Name"
IDS_LIST_COLUMN_TYPE "Type"
IDS_LIST_COLUMN_DATA "Data"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_APP_TITLE "ReactOS Registry Editor"
IDC_REGEDT32 "REGED32"
IDC_REGEDT32_FRAME "REGED32_FRAME"
IDS_APP_REG_KEY "\\Regedt32"
IDS_APP_REG_PATH RES_STR_ROSAPP_REGISTRY_ROOT
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (Australia) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
ID_HELP_HELPTOPICS "Opens Registry Editor Help."
ID_HELP_ABOUT "Displays program information, version number, and copyright."
END
#endif // English (Australia) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

View file

@ -1,112 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by regedt32.rc
//
#define ID_REGISTRY_MENU 0
#define ID_EDIT_MENU 1
#define ID_TREE_MENU 2
#define ID_VIEW_MENU 3
#define ID_SECURITY_MENU 4
#define ID_OPTIONS_MENU 5
#define ID_WINDOW_MENU 6
#define ID_HELP_MENU 7
#define IDS_LIST_COLUMN_FIRST 91
#define IDS_LIST_COLUMN_NAME 91
#define IDS_LIST_COLUMN_TYPE 92
#define IDS_LIST_COLUMN_DATA 93
#define IDS_LIST_COLUMN_LAST 93
#define IDD_ABOUTBOX 101
#define IDS_APP_TITLE 102
#define IDI_REGEDT32 103
#define IDI_SMALL 104
#define IDC_REGEDT32 105
#define IDC_REGEDT32_FRAME 106
#define IDR_REGEDT32_MENU 107
#define IDS_APP_REG_KEY 108
#define IDS_APP_REG_PATH 109
#define IDB_OPEN_FILE 132
#define IDB_CLOSED_FILE 133
#define IDB_ROOT 134
#define ID_REGISTRY_EXIT 32770
#define ID_WINDOW_TILE 32772
#define ID_WINDOW_TILE_VERT 32772
#define ID_WINDOW_REFRESH 32773
#define ID_VIEW_STATUSBAR 32774
#define ID_VIEW_SPLIT 32775
#define ID_VIEW_REFRESH 32776
#define ID_EDIT_DELETE 32778
#define ID_EDIT_RENAME 32779
#define ID_EDIT_COPYKEYNAME 32781
#define ID_EDIT_FIND 32782
#define ID_EDIT_FINDNEXT 32783
#define ID_EDIT_MODIFY 32784
#define ID_EDIT_NEW_KEY 32785
#define ID_EDIT_NEW_STRINGVALUE 32786
#define ID_EDIT_NEW_BINARYVALUE 32787
#define ID_EDIT_NEW_DWORDVALUE 32788
#define ID_REGISTRY_IMPORTREGISTRYFILE 32789
#define ID_REGISTRY_EXPORTREGISTRYFILE 32790
#define ID_REGISTRY_CONNECTNETWORKREGISTRY 32791
#define ID_REGISTRY_DISCONNECTNETWORKREGISTRY 32792
#define ID_REGISTRY_PRINT 32793
#define ID_HELP_HELPTOPICS 32794
#define ID_HELP_ABOUT 32795
#define ID_HELP_CONTENTS 32796
#define ID_WINDOW_CASCADE 32797
#define ID_WINDOW_TILE_HORZ 32798
#define ID_WINDOW_ARRANGEICONS 32799
#define ID_OPTIONS_FONT 32800
#define ID_OPTIONS_AUTOREFRESH 32801
#define ID_OPTIONS_READONLYMODE 32802
#define ID_OPTIONS_CONFIRMONDELETE 32803
#define ID_OPTIONS_SAVESETTINGSONEXIT 32804
#define ID_SECURITY_PERMISSIONS 32805
#define ID_VIEW_TREEANDDATA 32806
#define ID_VIEW_TREEONLY 32807
#define ID_VIEW_DATAONLY 32808
#define ID_VIEW_DISPLAYBINARYDATA 32810
#define ID_VIEW_REFRESHALL 32811
#define ID_VIEW_REFRESHACTIVE 32812
#define ID_VIEW_FINDKEY 32813
#define ID_TREE_EXPANDONELEVEL 32814
#define ID_TREE_EXPANDBRANCH 32815
#define ID_TREE_EXPANDALL 32816
#define ID_TREE_COLLAPSEBRANCH 32817
#define ID_EDIT_ADDKEY 32818
#define ID_EDIT_ADDVALUE 32819
#define ID_EDIT_BINARY 32821
#define ID_EDIT_STRING 32822
#define ID_EDIT_DWORD 32823
#define ID_EDIT_MULTISTRING 32824
#define ID_REGISTRY_OPENLOCAL 32825
#define ID_REGISTRY_CLOSE 32826
#define ID_REGISTRY_LOADHIVE 32827
#define ID_REGISTRY_UNLOADHIVE 32828
#define ID_REGISTRY_RESTORE 32829
#define ID_REGISTRY_SAVEKEY 32830
#define ID_REGISTRY_SELECTCOMPUTER 32831
#define ID_REGISTRY_PRINTSUBTREE 32832
#define ID_REGISTRY_PRINTERSETUP 32833
#define ID_REGISTRY_SAVESUBTREEAS 32834
#define IDC_LICENSE_EDIT 1029
#define IDS_LICENSE 32835
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 132
#define _APS_NEXT_COMMAND_VALUE 32836
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif

View file

@ -1,126 +0,0 @@
/*
* ReactOS regedt32
*
* settings.c
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <tchar.h>
#include <assert.h>
#define ASSERT assert
#include "main.h"
#include "settings.h"
static BOOL CheckResult(LONG error)
{
if (error != ERROR_SUCCESS) {
PTSTR msg;
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL))
MessageBox(NULL, msg, szTitle, MB_ICONERROR | MB_OK);
else
MessageBox(NULL, _T("Error"), szTitle, MB_ICONERROR | MB_OK);
LocalFree(msg);
return FALSE;
}
return TRUE;
}
static BOOL CreateRegistryPath(LPTSTR szRegPath, int nMaxLen)
{
LPTSTR pRegPath = szRegPath;
// Initialise registry path string from application PATH and KEY resources
int nLength = LoadString(hInst, IDS_APP_REG_PATH, szRegPath, nMaxLen);
nLength += LoadString(hInst, IDS_APP_REG_KEY, szRegPath + nLength, nMaxLen - nLength);
ASSERT(nLength < (nMaxLen - 1));
szRegPath[nLength] = _T('\\');
// walk the registry path string creating the tree if required
while (pRegPath = _tcschr(pRegPath, _T('\\'))) {
LONG result;
HKEY hKey = NULL;
*pRegPath = _T('\0');
// Open (or create) the key
result = RegCreateKeyEx(HKEY_CURRENT_USER, szRegPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
if (!CheckResult(result)) return FALSE;
RegCloseKey(hKey);
*pRegPath = _T('\\');
pRegPath = pRegPath + 1;
}
szRegPath[nLength] = _T('\0');
return TRUE;
}
void LoadSettings(void)
{
TCHAR szRegPath[MAX_LOADSTRING];
HKEY hKey;
DWORD dwSize;
LONG result;
if (!CreateRegistryPath(szRegPath, MAX_LOADSTRING)) return;
// Open the key
result = RegOpenKeyEx(HKEY_CURRENT_USER, szRegPath, 0, KEY_READ, &hKey);
if (!CheckResult(result)) return;
// Read the settings
dwSize = sizeof(enum OPTION_FLAGS);
result = RegQueryValueEx(hKey, _T("Preferences"), NULL, NULL, (LPBYTE)&Options, &dwSize);
// Close the key
RegCloseKey(hKey);
}
void SaveSettings(void)
{
TCHAR szRegPath[MAX_LOADSTRING];
HKEY hKey = NULL;
LONG result;
if (!CreateRegistryPath(szRegPath, MAX_LOADSTRING)) return;
// Open the key
result = RegOpenKeyEx(HKEY_CURRENT_USER, szRegPath, 0, KEY_READ | KEY_WRITE, &hKey);
if (!CheckResult(result)) return;
// When options are NOT to be saved we reload the options word, clean the save bit and write it back
if (!(Options & OPTIONS_SAVE_ON_EXIT)) {
DWORD dwSize = sizeof(enum OPTION_FLAGS);
result = RegQueryValueEx(hKey, _T("Preferences"), NULL, NULL, (LPBYTE)&Options, &dwSize);
if (result == ERROR_SUCCESS) {
Options &= ~OPTIONS_SAVE_ON_EXIT;
RegSetValueEx(hKey, _T("Preferences"), 0, REG_DWORD, (LPBYTE)&Options, sizeof(enum OPTION_FLAGS));
}
goto abort;
}
// Save the settings
result = RegSetValueEx(hKey, _T("Preferences"), 0, REG_DWORD, (LPBYTE)&Options, sizeof(enum OPTION_FLAGS));
if (!CheckResult(result)) goto abort;
abort:
// Close the key
RegCloseKey(hKey);
}

View file

@ -1,43 +0,0 @@
/*
* ReactOS regedt32
*
* settings.h
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __SETTINGS_H__
#define __SETTINGS_H__
#ifdef __cplusplus
extern "C" {
#endif
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
void LoadSettings(void);
void SaveSettings(void);
#ifdef __cplusplus
};
#endif
#endif // __SETTINGS_H__

View file

@ -1,259 +0,0 @@
/*
* ReactOS regedit
*
* treeview.c
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef _MSC_VER
#include "stdafx.h"
#else
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <commctrl.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <process.h>
#include <stdio.h>
#endif
#include "main.h"
#include "treeview.h"
// Global variables and constants
// Image_Open, Image_Closed, and Image_Root - integer variables for indexes of the images.
// CX_BITMAP and CY_BITMAP - width and height of an icon.
// NUM_BITMAPS - number of bitmaps to add to the image list.
int Image_Open;
int Image_Closed;
int Image_Root;
#define CX_BITMAP 16
#define CY_BITMAP 16
#define NUM_BITMAPS 3
HKEY FindRegRoot(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, int max)
{
HKEY hKey = NULL;
TVITEM item;
item.mask = TVIF_PARAM;
item.hItem = TreeView_GetParent(hwndTV, hItem);
if (TreeView_GetItem(hwndTV, &item)) {
if (item.lParam == 0) {
// recurse
hKey = FindRegRoot(hwndTV, item.hItem, keyPath, pPathLen, max);
keyPath[*pPathLen] = _T('\\');
++(*pPathLen);
item.mask = TVIF_TEXT;
item.hItem = hItem;
item.pszText = &keyPath[*pPathLen];
item.cchTextMax = max - *pPathLen;
if (TreeView_GetItem(hwndTV, &item)) {
*pPathLen += _tcslen(item.pszText);
}
} else {
// found root key with valid key value
hKey = (HKEY)item.lParam;
item.mask = TVIF_TEXT;
item.hItem = hItem;
// item.pszText = &keyPath[*pPathLen];
item.pszText = keyPath;
item.cchTextMax = max;
if (TreeView_GetItem(hwndTV, &item)) {
*pPathLen += _tcslen(item.pszText);
}
}
}
return hKey;
}
static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPTSTR label, HKEY hKey, DWORD dwChildren)
{
HTREEITEM hItem = 0;
TVITEM tvi;
TVINSERTSTRUCT tvins;
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
tvi.pszText = label;
tvi.cchTextMax = lstrlen(tvi.pszText);
tvi.iImage = Image_Closed;
tvi.iSelectedImage = Image_Open;
tvi.cChildren = dwChildren;
tvi.lParam = (LPARAM)hKey;
tvins.item = tvi;
if (hKey) tvins.hInsertAfter = (HTREEITEM)TVI_LAST;
else tvins.hInsertAfter = (HTREEITEM)TVI_SORT;
tvins.hParent = hParent;
hItem = (HTREEITEM)SendMessage(hwndTV, TVM_INSERTITEM, 0, (LPARAM)(LPTVINSERTSTRUCT)&tvins);
return hItem;
}
static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR szKeyName, HKEY hKey)
{
TVITEM tvi;
TVINSERTSTRUCT tvins;
HTREEITEM hRoot;
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
// Set the text of the item.
tvi.pszText = szKeyName;
tvi.cchTextMax = lstrlen(tvi.pszText);
// Assume the item is not a parent item, so give it an image.
tvi.iImage = Image_Root;
tvi.iSelectedImage = Image_Root;
tvi.cChildren = 5;
// Save the heading level in the item's application-defined data area.
//tvi.lParam = (LPARAM)NULL;
tvi.lParam = (LPARAM)hKey;
tvins.item = tvi;
tvins.hInsertAfter = (HTREEITEM)TVI_FIRST;
tvins.hParent = TVI_ROOT;
// Add the item to the tree view control.
hRoot = (HTREEITEM)SendMessage(hwndTV, TVM_INSERTITEM, 0, (LPARAM)(LPTVINSERTSTRUCT)&tvins);
// AddEntryToTree(hwndTV, hRoot, _T("HKEY_CLASSES_ROOT"), HKEY_CLASSES_ROOT, 1);
// AddEntryToTree(hwndTV, hRoot, _T("HKEY_CURRENT_USER"), HKEY_CURRENT_USER, 1);
// AddEntryToTree(hwndTV, hRoot, _T("HKEY_LOCAL_MACHINE"), HKEY_LOCAL_MACHINE, 1);
// AddEntryToTree(hwndTV, hRoot, _T("HKEY_USERS"), HKEY_USERS, 1);
// AddEntryToTree(hwndTV, hRoot, _T("HKEY_CURRENT_CONFIG"), HKEY_CURRENT_CONFIG, 1);
return TRUE;
}
// InitTreeViewImageLists - creates an image list, adds three bitmaps
// to it, and associates the image list with a tree view control.
// Returns TRUE if successful, or FALSE otherwise.
// hwndTV - handle to the tree view control.
static BOOL InitTreeViewImageLists(HWND hwndTV)
{
HIMAGELIST himl; // handle to image list
HBITMAP hbmp; // handle to bitmap
// Create the image list.
if ((himl = ImageList_Create(CX_BITMAP, CY_BITMAP,
FALSE, NUM_BITMAPS, 0)) == NULL)
return FALSE;
// Add the open file, closed file, and document bitmaps.
hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_OPEN_FILE));
Image_Open = ImageList_Add(himl, hbmp, (HBITMAP) NULL);
DeleteObject(hbmp);
hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_CLOSED_FILE));
Image_Closed = ImageList_Add(himl, hbmp, (HBITMAP) NULL);
DeleteObject(hbmp);
hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_ROOT));
Image_Root = ImageList_Add(himl, hbmp, (HBITMAP) NULL);
DeleteObject(hbmp);
// Fail if not all of the images were added.
if (ImageList_GetImageCount(himl) < 3)
return FALSE;
// Associate the image list with the tree view control.
TreeView_SetImageList(hwndTV, himl, TVSIL_NORMAL);
return TRUE;
}
BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
{
HKEY hKey;
TCHAR keyPath[1000];
int keyPathLen = 0;
static int expanding;
if (expanding) return FALSE;
if (pnmtv->itemNew.state & TVIS_EXPANDEDONCE ) {
return TRUE;
}
expanding = TRUE;
// check if this is either the root or a subkey item...
if ((HKEY)pnmtv->itemNew.lParam == NULL) {
keyPath[0] = _T('\0');
hKey = FindRegRoot(hwndTV, pnmtv->itemNew.hItem, keyPath, &keyPathLen, sizeof(keyPath));
} else {
hKey = (HKEY)pnmtv->itemNew.lParam;
keyPath[0] = _T('\0');
}
if (hKey != NULL) {
HKEY hNewKey;
LONG errCode = RegOpenKeyEx(hKey, keyPath, 0, KEY_READ, &hNewKey);
if (errCode == ERROR_SUCCESS) {
TCHAR Name[MAX_NAME_LEN];
DWORD cName = MAX_NAME_LEN;
FILETIME LastWriteTime;
DWORD dwIndex = 0L;
//ShowWindow(hwndTV, SW_HIDE);
while (RegEnumKeyEx(hNewKey, dwIndex, Name, &cName, NULL, NULL, NULL, &LastWriteTime) == ERROR_SUCCESS) {
DWORD dwCount = 0L;
errCode = RegOpenKeyEx(hNewKey, Name, 0, KEY_READ, &hKey);
if (errCode == ERROR_SUCCESS) {
TCHAR SubName[MAX_NAME_LEN];
DWORD cSubName = MAX_NAME_LEN;
// if (RegEnumKeyEx(hKey, 0, SubName, &cSubName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
while (RegEnumKeyEx(hKey, dwCount, SubName, &cSubName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
++dwCount;
}
}
RegCloseKey(hKey);
AddEntryToTree(hwndTV, pnmtv->itemNew.hItem, Name, NULL, dwCount);
cName = MAX_NAME_LEN;
++dwIndex;
}
//ShowWindow(hwndTV, SW_SHOWNOACTIVATE);
RegCloseKey(hNewKey);
}
} else {
}
expanding = FALSE;
return TRUE;
}
// CreateTreeView - creates a tree view control.
// Returns the handle to the new control if successful, or NULL otherwise.
// hwndParent - handle to the control's parent window.
HWND CreateTreeView(HWND hwndParent, LPTSTR szKeyName, HKEY hKey)
{
RECT rcClient;
HWND hwndTV;
// Get the dimensions of the parent window's client area, and create the tree view control.
GetClientRect(hwndParent, &rcClient);
hwndTV = CreateWindowEx(0, WC_TREEVIEW, _T("Tree View"),
WS_VISIBLE | WS_CHILD | WS_EX_CLIENTEDGE | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
0, 0, rcClient.right, rcClient.bottom,
hwndParent, (HMENU)TREE_WINDOW, hInst, NULL);
// Initialize the image list, and add items to the control.
if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, szKeyName, hKey)) {
DestroyWindow(hwndTV);
return NULL;
}
return hwndTV;
}

View file

@ -1,44 +0,0 @@
/*
* ReactOS regedit
*
* treeview.h
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __TREEVIEW_H__
#define __TREEVIEW_H__
#ifdef __cplusplus
extern "C" {
#endif
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
HWND CreateTreeView(HWND hwndParent, LPTSTR szKeyName, HKEY hKey);
BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
HKEY FindRegRoot(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, int max);
#ifdef __cplusplus
};
#endif
#endif // __TREEVIEW_H__