mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 00:54:40 +00:00
* Remove calc, regedt32, and regsvr32; Moved to reactos.
svn path=/trunk/; revision=11767
This commit is contained in:
parent
fd70584747
commit
19f47c9b4f
46 changed files with 1 additions and 8643 deletions
|
@ -8,8 +8,7 @@ include rules.mak
|
|||
# Available applications
|
||||
#
|
||||
|
||||
APPS = calc \
|
||||
cmdutils \
|
||||
APPS = cmdutils \
|
||||
cmdutils$(SEP)mode \
|
||||
cmdutils$(SEP)touch \
|
||||
demos$(SEP)maze \
|
||||
|
@ -35,8 +34,6 @@ APPS = calc \
|
|||
net$(SEP)ncftp \
|
||||
net$(SEP)netstat \
|
||||
net$(SEP)ipconfig \
|
||||
regedt32 \
|
||||
regsvr32 \
|
||||
sysutils$(SEP)regexpl \
|
||||
tests \
|
||||
welcome \
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
*.sys
|
||||
*.exe
|
||||
*.dll
|
||||
*.cpl
|
||||
*.a
|
||||
*.o
|
||||
*.d
|
||||
*.coff
|
||||
*.dsp
|
||||
*.dsw
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opt
|
||||
*.sym
|
||||
*.plg
|
||||
*.bak
|
||||
*.map
|
|
@ -1,155 +0,0 @@
|
|||
/*
|
||||
* WineCalc (En.rc)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "resource.h"
|
||||
#include "winecalc.h"
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_APPNAME, "Calculator"
|
||||
|
||||
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
|
||||
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
|
||||
IDS_COPYRIGHT3 "San Jose, California, USA"
|
||||
IDS_COPYRIGHT4 "james@ActionMessage.com"
|
||||
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
|
||||
|
||||
IDS_BTN_BACKSPACE, "Backspace"
|
||||
IDS_BTN_CLEAR_ENTRY, "CE"
|
||||
IDS_BTN_CLEAR_ALL, "C"
|
||||
IDS_BTN_MEM_CLEAR, "MC"
|
||||
IDS_BTN_MEM_RECALL, "MR"
|
||||
IDS_BTN_MEM_STORE, "MS"
|
||||
IDS_BTN_MEM_PLUS, "M+"
|
||||
IDS_BTN_MEM_STATUS_M, "M"
|
||||
IDS_BTN_SQRT, "sqrt"
|
||||
IDS_ERR_INVALID_INPUT, "Invalid input for function."
|
||||
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
|
||||
IDS_ERR_UNDEFINED, "Result of function is undefined."
|
||||
}
|
||||
|
||||
MAIN_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIMS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
|
||||
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
|
||||
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIWS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
|
||||
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
|
||||
MENUITEM "Word\tF3", ID_CALC_WS_WORD
|
||||
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
MAIN_MENU ACCELERATORS
|
||||
BEGIN
|
||||
VK_F1, IDV_HELP, VIRTKEY
|
||||
END
|
||||
|
||||
DLG_ABOUT DIALOG 12,0,120,82
|
||||
CAPTION "About GNU winecalc"
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
|
||||
END
|
||||
|
||||
WHATS_THIS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "" {
|
||||
MENUITEM "What's This?", IDM_WHATS_THIS
|
||||
}
|
||||
}
|
||||
|
||||
DLG_STATS DIALOG 12,0,125,78
|
||||
CAPTION "Statistics Box"
|
||||
FONT 9, "Tahoma"
|
||||
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
END
|
|
@ -1,155 +0,0 @@
|
|||
/*
|
||||
* WineCalc (Es.rc)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "resource.h"
|
||||
#include "winecalc.h"
|
||||
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_APPNAME, "Calculator"
|
||||
|
||||
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
|
||||
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
|
||||
IDS_COPYRIGHT3 "San Jose, California, USA"
|
||||
IDS_COPYRIGHT4 "james@ActionMessage.com"
|
||||
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
|
||||
|
||||
IDS_BTN_BACKSPACE, "Backspace"
|
||||
IDS_BTN_CLEAR_ENTRY, "CE"
|
||||
IDS_BTN_CLEAR_ALL, "C"
|
||||
IDS_BTN_MEM_CLEAR, "MC"
|
||||
IDS_BTN_MEM_RECALL, "MR"
|
||||
IDS_BTN_MEM_STORE, "MS"
|
||||
IDS_BTN_MEM_PLUS, "M+"
|
||||
IDS_BTN_MEM_STATUS_M, "M"
|
||||
IDS_BTN_SQRT, "sqrt"
|
||||
IDS_ERR_INVALID_INPUT, "Invalid input for function."
|
||||
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
|
||||
IDS_ERR_UNDEFINED, "Result of function is undefined."
|
||||
}
|
||||
|
||||
MAIN_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIMS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
|
||||
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
|
||||
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIWS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
|
||||
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
|
||||
MENUITEM "Word\tF3", ID_CALC_WS_WORD
|
||||
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
MAIN_MENU ACCELERATORS
|
||||
BEGIN
|
||||
VK_F1, IDV_HELP, VIRTKEY
|
||||
END
|
||||
|
||||
WHATS_THIS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "" {
|
||||
MENUITEM "What's This?", IDM_WHATS_THIS
|
||||
}
|
||||
}
|
||||
|
||||
DLG_ABOUT DIALOG 12,0,120,82
|
||||
CAPTION "About GNU winecalc"
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
|
||||
END
|
||||
|
||||
DLG_STATS DIALOG 12,0,125,78
|
||||
CAPTION "Statistics Box"
|
||||
FONT 9, "Tahoma"
|
||||
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
END
|
|
@ -1,155 +0,0 @@
|
|||
/*
|
||||
* WineCalc (Fr.rc)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "resource.h"
|
||||
#include "winecalc.h"
|
||||
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_APPNAME, "Calculator"
|
||||
|
||||
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
|
||||
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
|
||||
IDS_COPYRIGHT3 "San Jose, California, USA"
|
||||
IDS_COPYRIGHT4 "james@ActionMessage.com"
|
||||
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
|
||||
|
||||
IDS_BTN_BACKSPACE, "Backspace"
|
||||
IDS_BTN_CLEAR_ENTRY, "CE"
|
||||
IDS_BTN_CLEAR_ALL, "C"
|
||||
IDS_BTN_MEM_CLEAR, "MC"
|
||||
IDS_BTN_MEM_RECALL, "MR"
|
||||
IDS_BTN_MEM_STORE, "MS"
|
||||
IDS_BTN_MEM_PLUS, "M+"
|
||||
IDS_BTN_MEM_STATUS_M, "M"
|
||||
IDS_BTN_SQRT, "sqrt"
|
||||
IDS_ERR_INVALID_INPUT, "Invalid input for function."
|
||||
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
|
||||
IDS_ERR_UNDEFINED, "Result of function is undefined."
|
||||
}
|
||||
|
||||
MAIN_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIMS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
|
||||
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
|
||||
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIWS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
|
||||
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
|
||||
MENUITEM "Word\tF3", ID_CALC_WS_WORD
|
||||
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
MAIN_MENU ACCELERATORS
|
||||
BEGIN
|
||||
VK_F1, IDV_HELP, VIRTKEY
|
||||
END
|
||||
|
||||
WHATS_THIS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "" {
|
||||
MENUITEM "What's This?", IDM_WHATS_THIS
|
||||
}
|
||||
}
|
||||
|
||||
DLG_ABOUT DIALOG 12,0,120,82
|
||||
CAPTION "About GNU winecalc"
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
|
||||
END
|
||||
|
||||
DLG_STATS DIALOG 12,0,125,78
|
||||
CAPTION "Statistics Box"
|
||||
FONT 9, "Tahoma"
|
||||
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
END
|
|
@ -1,155 +0,0 @@
|
|||
/*
|
||||
* WineCalc (It.rc)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "resource.h"
|
||||
#include "winecalc.h"
|
||||
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_APPNAME, "Calculator"
|
||||
|
||||
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
|
||||
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
|
||||
IDS_COPYRIGHT3 "San Jose, California, USA"
|
||||
IDS_COPYRIGHT4 "james@ActionMessage.com"
|
||||
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
|
||||
|
||||
IDS_BTN_BACKSPACE, "Backspace"
|
||||
IDS_BTN_CLEAR_ENTRY, "CE"
|
||||
IDS_BTN_CLEAR_ALL, "C"
|
||||
IDS_BTN_MEM_CLEAR, "MC"
|
||||
IDS_BTN_MEM_RECALL, "MR"
|
||||
IDS_BTN_MEM_STORE, "MS"
|
||||
IDS_BTN_MEM_PLUS, "M+"
|
||||
IDS_BTN_MEM_STATUS_M, "M"
|
||||
IDS_BTN_SQRT, "sqrt"
|
||||
IDS_ERR_INVALID_INPUT, "Invalid input for function."
|
||||
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
|
||||
IDS_ERR_UNDEFINED, "Result of function is undefined."
|
||||
}
|
||||
|
||||
MAIN_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIMS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
|
||||
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
|
||||
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIWS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
|
||||
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
|
||||
MENUITEM "Word\tF3", ID_CALC_WS_WORD
|
||||
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
MAIN_MENU ACCELERATORS
|
||||
BEGIN
|
||||
VK_F1, IDV_HELP, VIRTKEY
|
||||
END
|
||||
|
||||
WHATS_THIS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "" {
|
||||
MENUITEM "What's This?", IDM_WHATS_THIS
|
||||
}
|
||||
}
|
||||
|
||||
DLG_ABOUT DIALOG 12,0,120,82
|
||||
CAPTION "About GNU winecalc"
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
|
||||
END
|
||||
|
||||
DLG_STATS DIALOG 12,0,125,78
|
||||
CAPTION "Statistics Box"
|
||||
FONT 9, "Tahoma"
|
||||
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
END
|
|
@ -1,155 +0,0 @@
|
|||
/*
|
||||
* WineCalc (Nl.rc)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "resource.h"
|
||||
#include "winecalc.h"
|
||||
|
||||
LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_APPNAME, "Calculator"
|
||||
|
||||
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
|
||||
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
|
||||
IDS_COPYRIGHT3 "San Jose, California, USA"
|
||||
IDS_COPYRIGHT4 "james@ActionMessage.com"
|
||||
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
|
||||
|
||||
IDS_BTN_BACKSPACE, "Backspace"
|
||||
IDS_BTN_CLEAR_ENTRY, "CE"
|
||||
IDS_BTN_CLEAR_ALL, "C"
|
||||
IDS_BTN_MEM_CLEAR, "MC"
|
||||
IDS_BTN_MEM_RECALL, "MR"
|
||||
IDS_BTN_MEM_STORE, "MS"
|
||||
IDS_BTN_MEM_PLUS, "M+"
|
||||
IDS_BTN_MEM_STATUS_M, "M"
|
||||
IDS_BTN_SQRT, "sqrt"
|
||||
IDS_ERR_INVALID_INPUT, "Invalid input for function."
|
||||
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
|
||||
IDS_ERR_UNDEFINED, "Result of function is undefined."
|
||||
}
|
||||
|
||||
MAIN_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIMS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
|
||||
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
|
||||
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIWS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
|
||||
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
|
||||
MENUITEM "Word\tF3", ID_CALC_WS_WORD
|
||||
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
MAIN_MENU ACCELERATORS
|
||||
BEGIN
|
||||
VK_F1, IDV_HELP, VIRTKEY
|
||||
END
|
||||
|
||||
WHATS_THIS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "" {
|
||||
MENUITEM "What's This?", IDM_WHATS_THIS
|
||||
}
|
||||
}
|
||||
|
||||
DLG_ABOUT DIALOG 12,0,120,82
|
||||
CAPTION "About GNU winecalc"
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
|
||||
END
|
||||
|
||||
DLG_STATS DIALOG 12,0,125,78
|
||||
CAPTION "Statistics Box"
|
||||
FONT 9, "Tahoma"
|
||||
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
END
|
|
@ -1,155 +0,0 @@
|
|||
/*
|
||||
* WineCalc (Pt.rc)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "resource.h"
|
||||
#include "winecalc.h"
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_APPNAME, "Calculator"
|
||||
|
||||
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
|
||||
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
|
||||
IDS_COPYRIGHT3 "San Jose, California, USA"
|
||||
IDS_COPYRIGHT4 "james@ActionMessage.com"
|
||||
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
|
||||
|
||||
IDS_BTN_BACKSPACE, "Backspace"
|
||||
IDS_BTN_CLEAR_ENTRY, "CE"
|
||||
IDS_BTN_CLEAR_ALL, "C"
|
||||
IDS_BTN_MEM_CLEAR, "MC"
|
||||
IDS_BTN_MEM_RECALL, "MR"
|
||||
IDS_BTN_MEM_STORE, "MS"
|
||||
IDS_BTN_MEM_PLUS, "M+"
|
||||
IDS_BTN_MEM_STATUS_M, "M"
|
||||
IDS_BTN_SQRT, "sqrt"
|
||||
IDS_ERR_INVALID_INPUT, "Invalid input for function."
|
||||
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
|
||||
IDS_ERR_UNDEFINED, "Result of function is undefined."
|
||||
}
|
||||
|
||||
MAIN_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIMS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
|
||||
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
|
||||
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIWS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
|
||||
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
|
||||
MENUITEM "Word\tF3", ID_CALC_WS_WORD
|
||||
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
MAIN_MENU ACCELERATORS
|
||||
BEGIN
|
||||
VK_F1, IDV_HELP, VIRTKEY
|
||||
END
|
||||
|
||||
WHATS_THIS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "" {
|
||||
MENUITEM "What's This?", IDM_WHATS_THIS
|
||||
}
|
||||
}
|
||||
|
||||
DLG_ABOUT DIALOG 12,0,120,82
|
||||
CAPTION "About GNU winecalc"
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
|
||||
END
|
||||
|
||||
DLG_STATS DIALOG 12,0,125,78
|
||||
CAPTION "Statistics Box"
|
||||
FONT 9, "Tahoma"
|
||||
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
END
|
|
@ -1,155 +0,0 @@
|
|||
/*
|
||||
* WineCalc (Ru.rc)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "resource.h"
|
||||
#include "winecalc.h"
|
||||
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_APPNAME, "Calculator"
|
||||
|
||||
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
|
||||
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
|
||||
IDS_COPYRIGHT3 "San Jose, California, USA"
|
||||
IDS_COPYRIGHT4 "james@ActionMessage.com"
|
||||
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
|
||||
|
||||
IDS_BTN_BACKSPACE, "Backspace"
|
||||
IDS_BTN_CLEAR_ENTRY, "CE"
|
||||
IDS_BTN_CLEAR_ALL, "C"
|
||||
IDS_BTN_MEM_CLEAR, "MC"
|
||||
IDS_BTN_MEM_RECALL, "MR"
|
||||
IDS_BTN_MEM_STORE, "MS"
|
||||
IDS_BTN_MEM_PLUS, "M+"
|
||||
IDS_BTN_MEM_STATUS_M, "M"
|
||||
IDS_BTN_SQRT, "sqrt"
|
||||
IDS_ERR_INVALID_INPUT, "Invalid input for function."
|
||||
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
|
||||
IDS_ERR_UNDEFINED, "Result of function is undefined."
|
||||
}
|
||||
|
||||
MAIN_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIMS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
|
||||
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
|
||||
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIWS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
|
||||
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
|
||||
MENUITEM "Word\tF3", ID_CALC_WS_WORD
|
||||
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
MAIN_MENU ACCELERATORS
|
||||
BEGIN
|
||||
VK_F1, IDV_HELP, VIRTKEY
|
||||
END
|
||||
|
||||
WHATS_THIS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "" {
|
||||
MENUITEM "What's This?", IDM_WHATS_THIS
|
||||
}
|
||||
}
|
||||
|
||||
DLG_ABOUT DIALOG 12,0,120,82
|
||||
CAPTION "About GNU winecalc"
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
|
||||
END
|
||||
|
||||
DLG_STATS DIALOG 12,0,125,78
|
||||
CAPTION "Statistics Box"
|
||||
FONT 9, "Tahoma"
|
||||
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
END
|
|
@ -1,156 +0,0 @@
|
|||
/*
|
||||
* WineCalc (Si.rc)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "resource.h"
|
||||
#include "winecalc.h"
|
||||
|
||||
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_APPNAME, "Calculator"
|
||||
|
||||
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
|
||||
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
|
||||
IDS_COPYRIGHT3 "San Jose, California, USA"
|
||||
IDS_COPYRIGHT4 "james@ActionMessage.com"
|
||||
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
|
||||
|
||||
IDS_BTN_BACKSPACE, "Backspace"
|
||||
IDS_BTN_CLEAR_ENTRY, "CE"
|
||||
IDS_BTN_CLEAR_ALL, "C"
|
||||
IDS_BTN_MEM_CLEAR, "MC"
|
||||
IDS_BTN_MEM_RECALL, "MR"
|
||||
IDS_BTN_MEM_STORE, "MS"
|
||||
IDS_BTN_MEM_PLUS, "M+"
|
||||
IDS_BTN_MEM_STATUS_M, "M"
|
||||
IDS_BTN_SQRT, "sqrt"
|
||||
IDS_ERR_INVALID_INPUT, "Invalid input for function."
|
||||
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
|
||||
IDS_ERR_UNDEFINED, "Result of function is undefined."
|
||||
}
|
||||
|
||||
MAIN_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIMS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
|
||||
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
|
||||
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
SCIWS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "&Edit" {
|
||||
MENUITEM "&Copy Ctrl+C", IDM_COPY
|
||||
MENUITEM "&Paste Ctrl+V", IDM_PASTE
|
||||
}
|
||||
POPUP "&View" {
|
||||
MENUITEM "Standard", IDM_MODE_STANDARD
|
||||
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
|
||||
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
|
||||
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
|
||||
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
|
||||
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
|
||||
MENUITEM "Word\tF3", ID_CALC_WS_WORD
|
||||
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
|
||||
}
|
||||
POPUP "&Help" {
|
||||
MENUITEM "Help Topics", IDM_HELP_TOPICS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "About Calculator", IDM_ABOUT
|
||||
}
|
||||
}
|
||||
|
||||
MAIN_MENU ACCELERATORS
|
||||
BEGIN
|
||||
VK_F1, IDV_HELP, VIRTKEY
|
||||
END
|
||||
|
||||
WHATS_THIS_MENU MENU DISCARDABLE
|
||||
{
|
||||
POPUP "" {
|
||||
MENUITEM "What's This?", IDM_WHATS_THIS
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DLG_ABOUT DIALOG 12,0,120,82
|
||||
CAPTION "About GNU winecalc"
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
|
||||
END
|
||||
|
||||
DLG_STATS DIALOG 12,0,125,78
|
||||
CAPTION "Statistics Box"
|
||||
FONT 9, "Tahoma"
|
||||
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
|
||||
END
|
|
@ -1,6 +0,0 @@
|
|||
/* Do not Make changes here */
|
||||
|
||||
#include <windows.h>
|
||||
#include <reactos/resource.h>
|
||||
|
||||
#include "rsrc.rc"
|
|
@ -1,93 +0,0 @@
|
|||
/*
|
||||
* WineCalc (dialog.c)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include "dialog.h"
|
||||
#include "resource.h"
|
||||
#include "winecalc.h"
|
||||
|
||||
extern HINSTANCE hInstance;
|
||||
|
||||
BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
HDC hdc;
|
||||
PAINTSTRUCT ps;
|
||||
|
||||
switch( uMsg ) {
|
||||
|
||||
case WM_INITDIALOG:
|
||||
SendMessage (hDlg, WM_SETFONT, (UINT)GetStockObject(DEFAULT_GUI_FONT), TRUE);
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
EndDialog( hDlg, 0 );
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
{
|
||||
HDC hMemDC;
|
||||
HFONT hFont;
|
||||
HFONT hFontOrg;
|
||||
|
||||
char c1[CALC_BUF_SIZE];
|
||||
char c2[CALC_BUF_SIZE];
|
||||
char c3[CALC_BUF_SIZE];
|
||||
char c4[CALC_BUF_SIZE];
|
||||
char c5[CALC_BUF_SIZE];
|
||||
|
||||
hdc = BeginPaint( hDlg, &ps );
|
||||
|
||||
hMemDC = CreateCompatibleDC( hdc );
|
||||
|
||||
LoadString( hInstance, IDS_COPYRIGHT1, c1, sizeof(c1));
|
||||
LoadString( hInstance, IDS_COPYRIGHT2, c2, sizeof(c2));
|
||||
LoadString( hInstance, IDS_COPYRIGHT3, c3, sizeof(c3));
|
||||
LoadString( hInstance, IDS_COPYRIGHT4, c4, sizeof(c4));
|
||||
LoadString( hInstance, IDS_COPYRIGHT5, c5, sizeof(c5));
|
||||
|
||||
hFont = GetStockObject(DEFAULT_GUI_FONT);
|
||||
hFontOrg = SelectObject(hdc, hFont);
|
||||
|
||||
SetBkMode(hdc, TRANSPARENT);
|
||||
|
||||
TextOut(hdc, 10, 10, c1, strlen(c1));
|
||||
TextOut(hdc, 10, 35, c2, strlen(c2));
|
||||
TextOut(hdc, 10, 50, c3, strlen(c3));
|
||||
TextOut(hdc, 10, 75, c4, strlen(c4));
|
||||
TextOut(hdc, 10, 90, c5, strlen(c5));
|
||||
|
||||
SelectObject(hdc, hFontOrg);
|
||||
|
||||
DeleteDC( hMemDC );
|
||||
EndPaint( hDlg, &ps );
|
||||
|
||||
return 0;
|
||||
}
|
||||
case WM_CLOSE:
|
||||
EndDialog( hDlg, TRUE );
|
||||
return 0;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* WineCalc (dialog.h)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
#
|
||||
# ReactOS calc
|
||||
#
|
||||
# Makefile
|
||||
#
|
||||
|
||||
PATH_TO_TOP = ../../reactos
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = windows
|
||||
|
||||
TARGET_NAME = calc
|
||||
|
||||
TARGET_CFLAGS = -D__USE_W32API -D_WIN32_IE=0x0501
|
||||
|
||||
TARGET_RCFLAGS = -D__USE_W32API -D_WIN32_IE=0x0501
|
||||
|
||||
TARGET_SDKLIBS = \
|
||||
kernel32.a \
|
||||
user32.a \
|
||||
gdi32.a
|
||||
|
||||
TARGET_GCCLIBS = comctl32
|
||||
|
||||
TARGET_OBJECTS = \
|
||||
dialog.o \
|
||||
stats.o \
|
||||
winecalc.o
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
||||
|
||||
# EOF
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* WineCalc (resource.h)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* menus */
|
||||
|
||||
#define IDM_COPY 1001
|
||||
#define IDM_PASTE 1002
|
||||
#define IDM_MODE_STANDARD 1003
|
||||
#define IDM_MODE_SCIENTIFIC 1004
|
||||
#define IDM_DIGIT_GROUPING 1005
|
||||
#define IDM_HELP_TOPICS 1006
|
||||
#define IDM_ABOUT 1007
|
||||
#define IDM_SEPARATOR1 1008
|
||||
#define IDM_SEPARATOR2 1009
|
||||
#define IDM_SEPARATOR3 1010
|
||||
#define IDM_WHATS_THIS 1011
|
||||
|
||||
/* strings */
|
||||
|
||||
#define IDS_APPNAME 1100
|
||||
|
||||
#define IDS_BTN_BACKSPACE 1101
|
||||
#define IDS_BTN_CLEAR_ENTRY 1102
|
||||
#define IDS_BTN_CLEAR_ALL 1103
|
||||
#define IDS_BTN_MEM_CLEAR 1104
|
||||
#define IDS_BTN_MEM_RECALL 1105
|
||||
#define IDS_BTN_MEM_STORE 1106
|
||||
#define IDS_BTN_MEM_PLUS 1107
|
||||
#define IDS_BTN_MEM_STATUS_M 1108
|
||||
#define IDS_BTN_SQRT 1109
|
||||
|
||||
#define IDS_ERR_INVALID_INPUT 1120
|
||||
#define IDS_ERR_DIVIDE_BY_ZERO 1121
|
||||
#define IDS_ERR_UNDEFINED 1122
|
||||
|
||||
#define IDS_COPYRIGHT1 1130
|
||||
#define IDS_COPYRIGHT2 1131
|
||||
#define IDS_COPYRIGHT3 1132
|
||||
#define IDS_COPYRIGHT4 1133
|
||||
#define IDS_COPYRIGHT5 1134
|
||||
|
||||
/* keys */
|
||||
|
||||
#define IDV_HELP 103
|
||||
|
||||
/* stats dialog */
|
||||
|
||||
#define ID_STATS_RET 3000
|
||||
#define ID_STATS_LOAD 3001
|
||||
#define ID_STATS_CD 3002
|
||||
#define ID_STATS_CAD 3003
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* WineCalc (rsrc.rc)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
|
||||
#include "En.rc"
|
||||
#include "Es.rc"
|
||||
#include "Fr.rc"
|
||||
#include "It.rc"
|
||||
#include "Nl.rc"
|
||||
#include "Pt.rc"
|
||||
#include "Ru.rc"
|
||||
#include "Si.rc"
|
||||
|
||||
LANGUAGE LANG_NEUTRAL,SUBLANG_NEUTRAL
|
|
@ -1,131 +0,0 @@
|
|||
/*
|
||||
* WineCalc (stats.c)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdio.h> // sprintf
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "stats.h"
|
||||
#include "resource.h"
|
||||
#include "winecalc.h"
|
||||
|
||||
HWND hWndListBox;
|
||||
|
||||
extern CALC calc;
|
||||
extern HWND hWndDlgStats;
|
||||
|
||||
BOOL CALLBACK StatsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
HDC hdc;
|
||||
PAINTSTRUCT ps;
|
||||
|
||||
|
||||
switch( uMsg ) {
|
||||
|
||||
case WM_INITDIALOG:
|
||||
hWndListBox = CreateWindow(
|
||||
"LISTBOX", // pointer to registered class name
|
||||
"Listbox", // pointer to window name
|
||||
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LBS_NOINTEGRALHEIGHT, // window style
|
||||
6, // horizontal position of window
|
||||
6, // vertical position of window
|
||||
208, // window width
|
||||
66, // window height
|
||||
hDlg, // handle to parent or owner window
|
||||
NULL, // handle to menu or child-window identifier
|
||||
NULL, // handle to application instance
|
||||
NULL // pointer to window-creation data
|
||||
);
|
||||
|
||||
ShowWindow(hWndListBox, SW_SHOW);
|
||||
|
||||
SendMessage (hWndListBox, WM_SETFONT, (UINT)GetStockObject(DEFAULT_GUI_FONT), TRUE);
|
||||
|
||||
// SetFocus(hWndDlgStats);
|
||||
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( LOWORD( wParam ) ) {
|
||||
|
||||
case ID_STATS_RET:
|
||||
SetFocus(GetParent(hDlg));
|
||||
return 0;
|
||||
|
||||
case ID_STATS_LOAD:
|
||||
{
|
||||
int i;
|
||||
|
||||
i = SendMessage(hWndListBox, LB_GETCURSEL, 0, 0);
|
||||
SendMessage(hWndListBox, LB_GETTEXT, i, (LPARAM)calc.buffer);
|
||||
calc_buffer_display(&calc);
|
||||
}
|
||||
return 0;
|
||||
|
||||
case ID_STATS_CD:
|
||||
{
|
||||
int i;
|
||||
|
||||
i = SendMessage(hWndListBox, LB_GETCURSEL, 0, 0);
|
||||
SendMessage(hWndListBox, LB_DELETESTRING, i, 0);
|
||||
InvalidateRect(hDlg,NULL,TRUE);
|
||||
UpdateWindow(hDlg);
|
||||
}
|
||||
return 0;
|
||||
|
||||
case ID_STATS_CAD:
|
||||
SendMessage(hWndListBox, LB_RESETCONTENT, 0, 0);
|
||||
InvalidateRect(hDlg,NULL,TRUE);
|
||||
UpdateWindow(hDlg);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
{
|
||||
char s[CALC_BUF_SIZE];
|
||||
int lb_count;
|
||||
HFONT hFont;
|
||||
HFONT hFontOrg;
|
||||
|
||||
hdc = BeginPaint( hDlg, &ps );
|
||||
hFont = GetStockObject(DEFAULT_GUI_FONT);
|
||||
hFontOrg = SelectObject(hdc, hFont);
|
||||
|
||||
lb_count = SendMessage(hWndListBox, LB_GETCOUNT, 0, 0);
|
||||
sprintf(s, "n=%d", lb_count);
|
||||
|
||||
SetBkMode(hdc, TRANSPARENT);
|
||||
TextOut(hdc, 98, 121, s, strlen(s));
|
||||
SelectObject(hdc, hFontOrg);
|
||||
EndPaint( hDlg, &ps );
|
||||
|
||||
return 0;
|
||||
}
|
||||
case WM_CLOSE:
|
||||
hWndDlgStats = 0; // invalidate stats dialog
|
||||
SendMessage(GetParent(hDlg), WM_CHAR, '\x13', 1); // disable stats related calculator buttons
|
||||
DestroyWindow( hDlg );
|
||||
|
||||
return 0;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* WineCalc (stats.h)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
BOOL CALLBACK StatsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,364 +0,0 @@
|
|||
/*
|
||||
* WineCalc (winecalc.h)
|
||||
*
|
||||
* Copyright 2003 James Briggs
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
// numerics are defined here for easier porting
|
||||
|
||||
typedef double calcfloat;
|
||||
#define FMT_DESC_FLOAT "%.32g"
|
||||
#define FMT_DESC_EXP "%.32e"
|
||||
|
||||
#define CALC_ATOF(x) atof(x)
|
||||
|
||||
#define CONST_PI 3.1415926535897932384626433832795
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
#define CALC_BUF_SIZE 128
|
||||
|
||||
// statistics dialog dimensions
|
||||
|
||||
#define CALC_STA_X 235
|
||||
#define CALC_STA_Y 180
|
||||
|
||||
// sentinel for differentiating Return from Ctrl+M events
|
||||
|
||||
#define NUMBER_OF_THE_BEAST 666
|
||||
|
||||
#define CALC_COLOR_BLUE 0
|
||||
#define CALC_COLOR_RED 1
|
||||
#define CALC_COLOR_GRAY 2
|
||||
#define CALC_COLOR_MAGENTA 3
|
||||
|
||||
// gray hilite on rectangle owner-drawn controls RGB(CALC_GRAY, CALC_GRAY, CALC_GRAY)
|
||||
|
||||
#define CALC_GRAY 132
|
||||
|
||||
// count of buttons needing special toggle states depending on number base
|
||||
|
||||
#define TOGGLE_COUNT 23
|
||||
|
||||
// there are 3 window menus, standard, decimal measurement system and word size menus
|
||||
|
||||
#define COUNT_MENUS 3
|
||||
#define MENU_STD 0
|
||||
#define MENU_SCIMS 1
|
||||
#define MENU_SCIWS 2
|
||||
|
||||
// count of buttons
|
||||
|
||||
#define CALC_BUTTONS_STANDARD 28
|
||||
#define CALC_BUTTONS_SCIENTIFIC 73
|
||||
|
||||
// winecalc window outer dimensions
|
||||
|
||||
#define CALC_STANDARD_WIDTH 260
|
||||
#define CALC_STANDARD_HEIGHT 252
|
||||
#define CALC_SCIENTIFIC_WIDTH 480
|
||||
#define CALC_SCIENTIFIC_HEIGHT 310
|
||||
|
||||
// winecalc private ids for events
|
||||
|
||||
#define ID_CALC_ZERO 0
|
||||
#define ID_CALC_ONE 1
|
||||
#define ID_CALC_TWO 2
|
||||
#define ID_CALC_THREE 3
|
||||
#define ID_CALC_FOUR 4
|
||||
#define ID_CALC_FIVE 5
|
||||
#define ID_CALC_SIX 6
|
||||
#define ID_CALC_SEVEN 7
|
||||
#define ID_CALC_EIGHT 8
|
||||
#define ID_CALC_NINE 9
|
||||
#define ID_CALC_BACKSPACE 20
|
||||
#define ID_CALC_CLEAR_ENTRY 21
|
||||
#define ID_CALC_CLEAR_ALL 22
|
||||
#define ID_CALC_MEM_CLEAR 23
|
||||
#define ID_CALC_DIVIDE 24
|
||||
#define ID_CALC_SQRT 25
|
||||
#define ID_CALC_MEM_RECALL 26
|
||||
#define ID_CALC_MULTIPLY 27
|
||||
#define ID_CALC_PERCENT 28
|
||||
#define ID_CALC_MEM_STORE 29
|
||||
#define ID_CALC_MINUS 30
|
||||
#define ID_CALC_RECIPROCAL 31
|
||||
#define ID_CALC_MEM_PLUS 32
|
||||
#define ID_CALC_SIGN 33
|
||||
#define ID_CALC_DECIMAL 34
|
||||
#define ID_CALC_PLUS 35
|
||||
#define ID_CALC_EQUALS 36
|
||||
#define ID_CALC_STA 37
|
||||
#define ID_CALC_FE 38
|
||||
#define ID_CALC_LEFTPAREN 39
|
||||
#define ID_CALC_RIGHTPAREN 40
|
||||
#define ID_CALC_MOD 41
|
||||
#define ID_CALC_AND 42
|
||||
#define ID_CALC_OR 43
|
||||
#define ID_CALC_XOR 44
|
||||
#define ID_CALC_SUM 45
|
||||
#define ID_CALC_SIN 46
|
||||
#define ID_CALC_LOG10 47
|
||||
#define ID_CALC_LSH 48
|
||||
#define ID_CALC_NOT 49
|
||||
#define ID_CALC_S 50
|
||||
#define ID_CALC_COS 52
|
||||
#define ID_CALC_FACTORIAL 53
|
||||
#define ID_CALC_INT 54
|
||||
#define ID_CALC_DAT 55
|
||||
#define ID_CALC_TAN 56
|
||||
#define ID_CALC_SQUARE 57
|
||||
#define ID_CALC_A 58
|
||||
#define ID_CALC_B 59
|
||||
#define ID_CALC_C 60
|
||||
#define ID_CALC_D 61
|
||||
#define ID_CALC_E 62
|
||||
#define ID_CALC_F 63
|
||||
#define ID_CALC_AVE 64
|
||||
#define ID_CALC_DMS 65
|
||||
#define ID_CALC_EXP 66
|
||||
#define ID_CALC_LN 67
|
||||
#define ID_CALC_PI 68
|
||||
#define ID_CALC_CUBE 69
|
||||
#define ID_CALC_POWER 51
|
||||
|
||||
// Number System Radio Buttons
|
||||
|
||||
#define CALC_NS_COUNT 4
|
||||
#define ID_CALC_NS_HEX 2000
|
||||
#define ID_CALC_NS_DEC 2001
|
||||
#define ID_CALC_NS_OCT 2002
|
||||
#define ID_CALC_NS_BIN 2003
|
||||
|
||||
#define NBASE_DECIMAL 0
|
||||
#define NBASE_BINARY 1
|
||||
#define NBASE_OCTAL 2
|
||||
#define NBASE_HEX 3
|
||||
|
||||
#define CALC_NS_OFFSET_X 15
|
||||
#define CALC_NS_OFFSET_Y 37
|
||||
|
||||
#define SZ_RADIO_NS_X 50
|
||||
#define SZ_RADIO_NS_Y 15
|
||||
|
||||
#define CALC_NS_HEX_LEFT 0
|
||||
#define CALC_NS_HEX_TOP 0
|
||||
|
||||
#define CALC_NS_DEC_LEFT 50
|
||||
#define CALC_NS_DEC_TOP 0
|
||||
|
||||
#define CALC_NS_OCT_LEFT 98
|
||||
#define CALC_NS_OCT_TOP 0
|
||||
|
||||
#define CALC_NS_BIN_LEFT 148
|
||||
#define CALC_NS_BIN_TOP 0
|
||||
|
||||
// Measurement System Radio Buttons
|
||||
|
||||
#define CALC_MS_COUNT 3
|
||||
#define ID_CALC_MS_DEGREES 2010
|
||||
#define ID_CALC_MS_RADIANS 2011
|
||||
#define ID_CALC_MS_GRADS 2012
|
||||
|
||||
#define TRIGMODE_DEGREES 0
|
||||
#define TRIGMODE_RADIANS 1
|
||||
#define TRIGMODE_GRADS 2
|
||||
|
||||
#define CALC_MS_OFFSET_X 225
|
||||
#define CALC_MS_OFFSET_Y 37
|
||||
|
||||
#define SZ_RADIO_MS_X 75
|
||||
#define SZ_RADIO_MS_Y 15
|
||||
|
||||
#define CALC_MS_DEGREES_LEFT 0
|
||||
#define CALC_MS_DEGREES_TOP 0
|
||||
|
||||
#define CALC_MS_RADIANS_LEFT 82
|
||||
#define CALC_MS_RADIANS_TOP 0
|
||||
|
||||
#define CALC_MS_GRADS_LEFT 162
|
||||
#define CALC_MS_GRADS_TOP 0
|
||||
|
||||
// Inv and Hyp Checkboxes
|
||||
|
||||
#define CALC_CB_COUNT 2
|
||||
#define ID_CALC_CB_INV 2020
|
||||
#define ID_CALC_CB_HYP 2021
|
||||
|
||||
#define WORDSIZE_BYTE 1
|
||||
#define WORDSIZE_WORD 2
|
||||
#define WORDSIZE_DWORD 4
|
||||
#define WORDSIZE_QWORD 8
|
||||
|
||||
#define CALC_CB_OFFSET_X 15
|
||||
#define CALC_CB_OFFSET_Y 58
|
||||
|
||||
#define CALC_CB_INV_LEFT 0
|
||||
#define CALC_CB_INV_TOP 10
|
||||
|
||||
#define SZ_RADIO_CB_X 50
|
||||
#define SZ_RADIO_CB_Y 14
|
||||
|
||||
#define CALC_CB_HYP_LEFT 58
|
||||
#define CALC_CB_HYP_TOP 10
|
||||
|
||||
// Word Size Radio Buttons
|
||||
|
||||
#define CALC_WS_COUNT 4
|
||||
#define ID_CALC_WS_QWORD 2030
|
||||
#define ID_CALC_WS_DWORD 2031
|
||||
#define ID_CALC_WS_WORD 2032
|
||||
#define ID_CALC_WS_BYTE 2033
|
||||
|
||||
#define CALC_WS_OFFSET_X CALC_MS_OFFSET_X
|
||||
#define CALC_WS_OFFSET_Y CALC_MS_OFFSET_Y
|
||||
|
||||
#define CALC_WS_QWORD_LEFT 0
|
||||
#define CALC_WS_QWORD_TOP 0
|
||||
|
||||
#define CALC_WS_DWORD_LEFT 57
|
||||
#define CALC_WS_DWORD_TOP 0
|
||||
|
||||
#define CALC_WS_WORD_LEFT 120
|
||||
#define CALC_WS_WORD_TOP 0
|
||||
|
||||
#define CALC_WS_BYTE_LEFT 175
|
||||
#define CALC_WS_BYTE_TOP 0
|
||||
|
||||
#define SZ_RADIO_WS_X 50
|
||||
#define SZ_RADIO_WS_Y 15
|
||||
|
||||
// drawing offsets
|
||||
|
||||
#define CALC_EDIT_HEIGHT 20
|
||||
|
||||
#define SZ_FILLER_X 32
|
||||
#define SZ_FILLER_Y 30
|
||||
|
||||
#define SZ_BIGBTN_X 62
|
||||
#define SZ_BIGBTN_Y 30
|
||||
|
||||
#define SZ_MEDBTN_X 36
|
||||
#define SZ_MEDBTN_Y 30
|
||||
|
||||
#define MARGIN_LEFT 7
|
||||
#define MARGIN_SMALL_X 3
|
||||
#define MARGIN_SMALL_Y 3
|
||||
#define MARGIN_BIG_X 274
|
||||
#define MARGIN_STANDARD_BIG_X 11
|
||||
#define MARGIN_BIG_Y 6
|
||||
|
||||
#define SZ_SPACER_X 11
|
||||
|
||||
// winecalc results display area
|
||||
|
||||
#define WDISPLAY_STANDARD_LEFT MARGIN_LEFT + 4
|
||||
#define WDISPLAY_STANDARD_TOP 5
|
||||
#define WDISPLAY_STANDARD_RIGHT 244
|
||||
#define WDISPLAY_STANDARD_BOTTOM 24
|
||||
#define CALC_STANDARD_MARGIN_TOP 16
|
||||
|
||||
#define WDISPLAY_SCIENTIFIC_LEFT MARGIN_LEFT + 4
|
||||
#define WDISPLAY_SCIENTIFIC_TOP 5
|
||||
#define WDISPLAY_SCIENTIFIC_RIGHT 465
|
||||
#define WDISPLAY_SCIENTIFIC_BOTTOM 24
|
||||
#define CALC_SCIENTIFIC_MARGIN_TOP 44
|
||||
|
||||
typedef struct tagCalcBtn {
|
||||
int id; // private id
|
||||
HWND hBtn; // button child window handle
|
||||
char label[80]; // text on buttonface
|
||||
int color; // text color
|
||||
RECT r; // location
|
||||
int enable; // 1 = control enbabled, 0 = disabled
|
||||
}
|
||||
CALCBTN;
|
||||
|
||||
typedef struct tagPos {
|
||||
int x;
|
||||
int y;
|
||||
}
|
||||
POS;
|
||||
|
||||
typedef struct tagCalc {
|
||||
HINSTANCE hInst; // this HINSTANCE
|
||||
HWND hWnd; // main window's HWND
|
||||
|
||||
POS pos;
|
||||
int numButtons; // standard = 28, scientific = more
|
||||
|
||||
char buffer [CALC_BUF_SIZE]; // current keyboard buffer
|
||||
char display[CALC_BUF_SIZE]; // display buffer before output
|
||||
|
||||
calcfloat value; // most recent computer value
|
||||
calcfloat memory; // most recent stored memory value from display buffer
|
||||
int paren; // current parentheses level
|
||||
|
||||
int sciMode; // standard = 1, scientific = 0
|
||||
int displayMode; // 0 = float, 1 = scientific exponential notation like 1.0e+10
|
||||
|
||||
char oper; // most recent operator pushed
|
||||
calcfloat operand; // most recent operand pushed
|
||||
int newenter; // track multiple =
|
||||
int next; // binary operation flag
|
||||
int err; // errror status for divide by zero, infinity, etc.
|
||||
int init; // starting buffer
|
||||
|
||||
int digitGrouping; // no separators = 0, separators = 1
|
||||
|
||||
int trigMode; // degrees = 0, radians = 1, grads = 2
|
||||
int numBase; // 10 = decimal, 2 = binary, 8 = octal, 16 = hex
|
||||
int wordSize; // 1 = byte, 2 = word, 4 = dword, 8 = qword
|
||||
int invMode; // INV mode 0 = off, 1 = on
|
||||
int hypMode; // HYP mode 0 = off, 1 = on
|
||||
|
||||
int new; // first time 0 = false, 1 = true
|
||||
CALCBTN cb[80]; // enough buttons for standard or scientific mode
|
||||
}
|
||||
CALC;
|
||||
|
||||
BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
void InitLuts(void);
|
||||
void InitMenus(HINSTANCE hInst);
|
||||
|
||||
void InitCalc (CALC *calc);
|
||||
void DestroyCalc (CALC *calc);
|
||||
|
||||
void calc_buffer_format(CALC *calc);
|
||||
void calc_buffer_display(CALC *calc);
|
||||
char *calc_sep(char *s);
|
||||
|
||||
void DrawCalcText (HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc, int object, char *s);
|
||||
void CalcRect (HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc, int object);
|
||||
void DrawCalcRectSci(HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc, RECT *r);
|
||||
void DrawCalc (HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc);
|
||||
|
||||
void calc_setmenuitem_radio(HMENU hMenu, UINT id);
|
||||
|
||||
void show_debug(CALC *calc, char *title, long wParam, long lParam);
|
||||
|
||||
calcfloat calc_atof(char *s, int base);
|
||||
void calc_ftoa(CALC *calc, calcfloat r, char *buf);
|
||||
long factorial(long n);
|
||||
|
||||
calcfloat calc_convert_to_radians(CALC *calc);
|
||||
calcfloat calc_convert_from_radians(CALC *calc);
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
*.sys
|
||||
*.exe
|
||||
*.dll
|
||||
*.cpl
|
||||
*.a
|
||||
*.o
|
||||
*.d
|
||||
*.coff
|
||||
*.dsp
|
||||
*.dsw
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opt
|
||||
*.sym
|
||||
*.plg
|
||||
*.bak
|
||||
*.map
|
|
@ -1,44 +0,0 @@
|
|||
#
|
||||
# ReactOS regedt32
|
||||
#
|
||||
# Makefile
|
||||
#
|
||||
|
||||
PATH_TO_TOP = ../../reactos
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = windows
|
||||
|
||||
TARGET_NAME = regedt32
|
||||
|
||||
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
|
||||
|
||||
# EOF
|
|
@ -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
|
|
@ -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_)
|
|
@ -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;
|
||||
}
|
|
@ -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__
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
@ -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__
|
|
@ -1,380 +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"
|
||||
|
||||
|
||||
#define LVM_GETITEMTEXTA (LVM_FIRST + 45)
|
||||
#define LVM_GETITEMTEXTW (LVM_FIRST + 115)
|
||||
|
||||
#ifdef UNICODE
|
||||
#define LVM_GETITEMTEXT LVM_GETITEMTEXTW
|
||||
#else
|
||||
#define LVM_GETITEMTEXT LVM_GETITEMTEXTA
|
||||
#endif
|
||||
|
||||
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
|
||||
{ LV_ITEM _ms_lvi;\
|
||||
_ms_lvi.iSubItem = iSubItem_;\
|
||||
_ms_lvi.cchTextMax = cchTextMax_;\
|
||||
_ms_lvi.pszText = pszText_;\
|
||||
SNDMSG((hwndLV), LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// 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;
|
||||
}
|
||||
|
|
@ -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__
|
|
@ -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;
|
||||
}
|
|
@ -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__
|
|
@ -1,261 +0,0 @@
|
|||
/* $Id: regedt32.rc,v 1.8 2004/10/16 22:30:18 gvg Exp $ */
|
||||
|
||||
#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 |
|
@ -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
|
|
@ -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);
|
||||
}
|
|
@ -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__
|
|
@ -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;
|
||||
}
|
|
@ -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__
|
|
@ -1,17 +0,0 @@
|
|||
*.sys
|
||||
*.exe
|
||||
*.dll
|
||||
*.cpl
|
||||
*.a
|
||||
*.o
|
||||
*.d
|
||||
*.coff
|
||||
*.dsp
|
||||
*.dsw
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opt
|
||||
*.sym
|
||||
*.plg
|
||||
*.bak
|
||||
*.map
|
|
@ -1,28 +0,0 @@
|
|||
# $Id: makefile,v 1.3 2004/06/01 01:13:29 sedwards Exp $
|
||||
#
|
||||
# Jurgen Van Gael [jurgen.vangael@student.kuleuven.ac.be]
|
||||
#
|
||||
# Makefile for ReactOS regsvr32.dll
|
||||
#
|
||||
|
||||
PATH_TO_TOP=../../reactos
|
||||
|
||||
TARGET_NORC = yes
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = regsvr32
|
||||
|
||||
TARGET_SDKLIBS = kernel32.a
|
||||
|
||||
TARGET_CFLAGS = -D__USE_W32API
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
||||
|
||||
# EOF
|
|
@ -1,172 +0,0 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS
|
||||
* FILE: apps\regsvr32\regsvr32.c
|
||||
* PURPOSE: Register a COM component in the registry
|
||||
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
|
||||
* UPDATE HISTORY:
|
||||
* Created 31/12/2001
|
||||
*/
|
||||
/********************************************************************
|
||||
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
********************************************************************/
|
||||
//
|
||||
// regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname
|
||||
// [/u] unregister server
|
||||
// [/s] silent (no message boxes)
|
||||
// [/i] Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall
|
||||
// [/n] Do not call DllRegisterServer; this option must be used with [/i]
|
||||
//
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <olectl.h>
|
||||
|
||||
typedef HRESULT (*DLLREGISTER) (void);
|
||||
typedef HRESULT (*DLLUNREGISTER) (void);
|
||||
|
||||
int Silent = 0;
|
||||
|
||||
int Usage()
|
||||
{
|
||||
printf("regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname\n");
|
||||
printf("\t[/u] unregister server\n");
|
||||
printf("\t[/s] silent (no message boxes)\n");
|
||||
printf("\t[/i] Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall\n");
|
||||
printf("\t[/n] Do not call DllRegisterServer; this option must be used with [/i]\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RegisterDll(char* strDll)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
DLLREGISTER pfRegister;
|
||||
HMODULE DllHandle = NULL;
|
||||
|
||||
DllHandle = LoadLibrary(strDll);
|
||||
if(!DllHandle)
|
||||
{
|
||||
if(!Silent)
|
||||
printf("Dll not found\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
pfRegister = (VOID*) GetProcAddress(DllHandle, "DllRegisterServer");
|
||||
if(!pfRegister)
|
||||
{
|
||||
if(!Silent)
|
||||
printf("DllRegisterServer not implemented\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
hr = pfRegister();
|
||||
if(FAILED(hr))
|
||||
{
|
||||
if(!Silent)
|
||||
printf("Failed to register dll\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
if(!Silent)
|
||||
printf("Succesfully registered dll\n");
|
||||
|
||||
// clean
|
||||
if(DllHandle)
|
||||
FreeLibrary(DllHandle);
|
||||
}
|
||||
|
||||
int UnregisterDll(char* strDll)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
HMODULE DllHandle = NULL;
|
||||
DLLUNREGISTER pfUnregister;
|
||||
|
||||
DllHandle = LoadLibrary(strDll);
|
||||
if(!DllHandle)
|
||||
{
|
||||
if(!Silent)
|
||||
printf("Dll not found\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
pfUnregister = (VOID*) GetProcAddress(DllHandle, "DllUnregisterServer");
|
||||
if(!pfUnregister)
|
||||
{
|
||||
if(!Silent)
|
||||
printf("DllUnregisterServer not implemented\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
hr = pfUnregister();
|
||||
if(FAILED(hr))
|
||||
{
|
||||
if(!Silent)
|
||||
printf("Failed to unregister dll\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
if(!Silent)
|
||||
printf("Succesfully unregistered dll\n");
|
||||
|
||||
// clean
|
||||
if(DllHandle)
|
||||
FreeLibrary(DllHandle);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int i = 0;
|
||||
int Unregister = 0;
|
||||
char DllName[MAX_PATH];
|
||||
|
||||
DllName[0] = '\0';
|
||||
|
||||
for(i = 0; i < argc; i++)
|
||||
{
|
||||
if(argv[i][0] == '/')
|
||||
{
|
||||
if(argv[i][1] == 'u')
|
||||
Unregister = 1;
|
||||
else if(argv[i][1] == 's')
|
||||
Silent = 1;
|
||||
else if(argv[i][1] == 'i')
|
||||
; // not implemented yet
|
||||
else if(argv[i][1] == 'n')
|
||||
; // not implemented yet
|
||||
}
|
||||
else
|
||||
strcpy(DllName, argv[i]);
|
||||
}
|
||||
|
||||
if(!strcmp(DllName, "regsvr32") || !strcmp(DllName, "regsvr32.exe"))
|
||||
{
|
||||
if(!Silent)
|
||||
return Usage();
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(Unregister == 0)
|
||||
return RegisterDll(DllName);
|
||||
else
|
||||
return UnregisterDll(DllName);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue