45 added + 3 modified, total 48 files
reactos
diff -u -r1.276 -r1.277
--- ChangeLog 21 Nov 2004 19:11:30 -0000 1.276
+++ ChangeLog 21 Nov 2004 21:02:02 -0000 1.277
@@ -1,5 +1,14 @@
2004-11-21 Casper S. Hornstrup <chorns@users.sourceforge.net>
+ * Makefile (SYS_APPS): Add calc, regedt32, and regsvr32.
+ * bootdata/packages/reactos.dff: Add calc.exe, regedt32.exe, and
+ regsvr32.exe.
+ * subsys/system/calc: New directory; Move here from rosapps.
+ * subsys/system/regedt32: Ditto.
+ * subsys/system/regsvr32: Ditto.
+
+2004-11-21 Casper S. Hornstrup <chorns@users.sourceforge.net>
+
* bootdata/hivesys.inf: Remove kmregtests.
2004-11-21 Casper S. Hornstrup <chorns@users.sourceforge.net>
reactos
diff -u -r1.261 -r1.262
--- Makefile 21 Nov 2004 18:40:38 -0000 1.261
+++ Makefile 21 Nov 2004 21:02:03 -0000 1.262
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.261 2004/11/21 18:40:38 chorns Exp $
+# $Id: Makefile,v 1.262 2004/11/21 21:02:03 chorns Exp $
#
# Global makefile
#
@@ -97,7 +97,9 @@
# System applications
# autochk cmd format services setup usetup welcome winlogon
-SYS_APPS = autochk cmd explorer expand format services setup taskmgr userinit usetup welcome vmwinst winlogon regedit winefile
+SYS_APPS = autochk calc cmd explorer expand format regedt32 regsvr32 \
+ services setup taskmgr userinit usetup welcome vmwinst winlogon \
+ regedit winefile
# System services
# rpcss eventlog
reactos/bootdata/packages
diff -u -r1.47 -r1.48
--- reactos.dff 21 Nov 2004 18:40:38 -0000 1.47
+++ reactos.dff 21 Nov 2004 21:02:03 -0000 1.48
@@ -122,12 +122,15 @@
subsys\smss\smss.exe 1
subsys\win32k\win32k.sys 1
subsys\system\autochk\autochk.exe 1
+subsys\system\calc\calc.exe 1
subsys\system\cmd\cmd.exe 1
subsys\system\explorer\explorer.exe 4
subsys\system\explorer\explorer-cfg-template.xml 4
subsys\system\explorer\notifyhook\notifyhook.dll 1
subsys\system\format\format.exe 1
subsys\system\regedit\regedit.exe 4
+subsys\system\regedt32\regedt32.exe 1
+subsys\system\regsvr32\regsvr32.exe 1
subsys\system\services\services.exe 1
subsys\system\setup\setup.exe 1
subsys\system\taskmgr\taskmgr.exe 1
reactos/subsys/system/calc
diff -N .cvsignore
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ .cvsignore 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,17 @@
+*.sys
+*.exe
+*.dll
+*.cpl
+*.a
+*.o
+*.d
+*.coff
+*.dsp
+*.dsw
+*.aps
+*.ncb
+*.opt
+*.sym
+*.plg
+*.bak
+*.map
reactos/subsys/system/calc
diff -N En.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ En.rc 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,155 @@
+/*
+ * 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
reactos/subsys/system/calc
diff -N Es.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Es.rc 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,155 @@
+/*
+ * 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
reactos/subsys/system/calc
diff -N Fr.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Fr.rc 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,155 @@
+/*
+ * 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
reactos/subsys/system/calc
diff -N It.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ It.rc 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,155 @@
+/*
+ * 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
reactos/subsys/system/calc
diff -N Nl.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Nl.rc 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,155 @@
+/*
+ * 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
reactos/subsys/system/calc
diff -N Pt.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Pt.rc 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,155 @@
+/*
+ * 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
reactos/subsys/system/calc
diff -N Ru.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Ru.rc 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,155 @@
+/*
+ * 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
reactos/subsys/system/calc
diff -N Si.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Si.rc 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,156 @@
+/*
+ * 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
reactos/subsys/system/calc
diff -N calc.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ calc.rc 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,6 @@
+/* Do not Make changes here */
+
+#include <windows.h>
+#include <reactos/resource.h>
+
+#include "rsrc.rc"
reactos/subsys/system/calc
diff -N dialog.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ dialog.c 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,93 @@
+/*
+ * 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;
+}
+
reactos/subsys/system/calc
diff -N dialog.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ dialog.h 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,24 @@
+/*
+ * 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 );
+
+
+
reactos/subsys/system/calc
diff -N makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ makefile 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,27 @@
+PATH_TO_TOP = ../../..
+
+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
reactos/subsys/system/calc
diff -N resource.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ resource.h 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,68 @@
+/*
+ * 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
reactos/subsys/system/calc
diff -N rsrc.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ rsrc.rc 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,33 @@
+/*
+ * 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
reactos/subsys/system/calc
diff -N stats.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ stats.c 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,131 @@
+/*
+ * 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;
+}
+
reactos/subsys/system/calc
diff -N stats.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ stats.h 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,24 @@
+/*
+ * 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 );
+
+
+
reactos/subsys/system/calc
diff -N winecalc.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ winecalc.c 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,3785 @@
+/*
+ * WineCalc (winecalc.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 <math.h>
+
+#include <windows.h>
+// #include <commctrl.h>
+
+#include "winecalc.h"
+#include "dialog.h"
+#include "stats.h"
+#include "resource.h"
+
+// lame M$ math library doesn't support hyp functions
+//#ifdef _MSC_VER
+#define atanh(X) atan(X)
+#define asinh(X) asin(X)
+#define acosh(X) acos(X)
+//#endif
+
+// How winecalc works
+//
+// 1. In the original calculator, numbers are "extended precision".
+// We emulate with calcfloat (calcfloat floating point) for now.
+// Note that recent M$ compilers 5.0 and later do not implement double float,
+// and do not support 80-bit numbers. Max width is 64-bits.
+//
+// 2. 4 temp areas:
+//
+// i) current edit buffer value for keystrokes
+// ii) computed value area for last computation
+// iii) memory area for MR, MC, MS, M+
+// iv) formatted display buffer
+//
+// 3. Memory Store works off current buffer, not value
+//
+// 4. display limit is 32 numbers plus 10 commas plus one period = 43 characters
+//
+// 5. original calc is better called SciCalc and saves settings in win.ini:
+//
+// [SciCalc]
+// layout=1 (0 = scientific mode, 1 = basic mode)
+// UseSep=1 (0 = no digits separator, 1 = enable digits separator)
+//
+// 6. Window Menus
+//
+// The menus know their own states, so we don't need to track them
+// When switching to Standard Calculator Mode, number base is changed to Decimal and Trig Mode to Degrees,
+// but Word Size Mode is unchanged
+//
+// 7. It would be nice to add command line parsing for batch files
+//
+
+// various display error messages
+
+static char err_invalid [CALC_BUF_SIZE];
+static char err_divide_by_zero [CALC_BUF_SIZE];
+static char err_undefined [CALC_BUF_SIZE];
+
+// calculator state is kept here
+
+CALC calc;
+
+static RECT rFiller;
+
+static int keys[CALC_NS_COUNT]['f'+1]; // note: sparse array
+
+// map from button press to calc[] index
+// 0, ... 9, A, B, C, D, E, F,FE,DMS,SIN,COS,TAN,EXP, PI
+static const int h[] = {
+ 0, 0, 33, 34, 21, 22, 23, 10, 11, 12, 54, 55, 56 ,57, 58 ,59, 6, 17, 28, 39, 50, 18, 53 };
+
+// enable status of various buttons on sci mode depending on number base
+static const int btn_toggle[CALC_NS_COUNT][TOGGLE_COUNT] =
+// 0, ... 9, A, B, C, D, E, F,FE,DMS,SIN,COS,TAN,EXP,PI
+{
+ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 },
+ { 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 }
+};
+
+static int hms[] = { 64, 65, 66 };
+static int hws[] = { 69, 70, 71, 72 };
+
+static int sta[] = { 16, 27, 38, 49 };
+
+static HMENU menus[3];
+
+static char appname[40];
+
+static int debug;
+
+int parse(int wParam, int lParam);
+
+HWND hWndDlgStats;
+
+extern HWND hWndListBox;
+
+HINSTANCE hInstance;
+
+int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow )
+{
+ MSG msg;
+ WNDCLASS wc;
+ HWND hWnd;
+ HACCEL haccel;
+
+ char s[CALC_BUF_SIZE];
+ int r;
+
+ hInstance = hInst;
+
+ r = GetProfileString("SciCalc",
+ "layout",
+ "0",
+ s,
+ CALC_BUF_SIZE
+ );
+
+ calc.sciMode = atoi(s);
+
+ if (calc.sciMode != 0 &&
+ calc.sciMode != 1)
+ calc.sciMode = 1; // Standard Mode
+
+ r = GetProfileString("SciCalc",
+ "UseSep",
+ "0",
+ s,
+ CALC_BUF_SIZE
+ );
+
+ calc.digitGrouping = atoi(s);
+
+ if (calc.digitGrouping != 0 &&
+ calc.digitGrouping != 1)
+ calc.digitGrouping = 1;
+
+ calc.new = 1; // initialize struct values
+
+ if (!LoadString( hInst, IDS_APPNAME, appname, sizeof(appname)))
+ exit(1);
+ if (!LoadString( hInst, IDS_ERR_INVALID_INPUT, err_invalid, sizeof(err_invalid)))
+ exit(1);
+ if (!LoadString( hInst, IDS_ERR_DIVIDE_BY_ZERO, err_divide_by_zero, sizeof(err_divide_by_zero)))
+ exit(1);
+ if (!LoadString( hInst, IDS_ERR_UNDEFINED, err_undefined, sizeof(err_undefined)))
+ exit(1);
+
+ wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.lpfnWndProc = MainProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInst;
+ wc.hIcon = LoadIcon( hInst, appname );
+ wc.hCursor = LoadCursor( NULL, IDI_APPLICATION );
+ wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = appname;
+
+ if (!RegisterClass(&wc)) exit(1);
+
+ hWnd = CreateWindow( appname,
+ appname,
+ WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ calc.sciMode ? CALC_STANDARD_WIDTH : CALC_SCIENTIFIC_WIDTH,
+ calc.sciMode ? CALC_STANDARD_HEIGHT : CALC_SCIENTIFIC_HEIGHT,
+ NULL,
+ NULL,
+ hInst,
+ NULL );
+
+ if (!hWnd)
+ exit(1);
+
+ ShowWindow( hWnd, cmdshow );
+ UpdateWindow( hWnd );
+
+ if (!(haccel = LoadAccelerators(hInst, "MAIN_MENU")))
+ exit(1);
+
+ while( GetMessage(&msg, NULL, 0, 0) ) {
+ if (hWndDlgStats == 0 || !IsDialogMessage(hWndDlgStats, &msg)) {
+ if (!TranslateAccelerator( hWnd, haccel, &msg )) {
+ TranslateMessage( &msg );
+ DispatchMessage( &msg );
+ }
+ }
+ }
+
+ return msg.wParam;
+}
+
+LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ HDC hdc;
+ PAINTSTRUCT ps;
+
+ switch (msg) {
+
+ case WM_CREATE:
+ calc.hInst = ((LPCREATESTRUCT) lParam)->hInstance;
+ calc.hWnd = hWnd;
+
+ InitLuts();
+ InitCalc( &calc );
+ InitMenus(calc.hInst);
+
+ if (calc.sciMode)
+ SetMenu(hWnd, menus[MENU_STD]);
+ else
+ SetMenu(hWnd, menus[MENU_SCIMS]);
+
+ calc_buffer_display(&calc);
+
+ return 0;
+
+ case WM_PAINT:
+ {
+ HDC hMemDC;
+
+ hdc = BeginPaint( hWnd, &ps );
+ hMemDC = CreateCompatibleDC( hdc );
+
+ DrawCalc( hdc, hMemDC, &ps, &calc );
+
+ DeleteDC( hMemDC );
+ EndPaint( hWnd, &ps );
+
+ return 0;
+ }
+
+ case WM_MOVE:
+ calc.pos.x = (unsigned) LOWORD(lParam);
+ calc.pos.y = (unsigned) HIWORD(lParam);
+ return 0;
+
+ case WM_DESTROY:
+ {
+ int r;
+ char s[CALC_BUF_SIZE];
+
+ sprintf(s, "%d", calc.sciMode);
+ r = WriteProfileString("SciCalc", "layout", s);
+
+ sprintf(s, "%d", calc.digitGrouping);
+ r = WriteProfileString("SciCalc", "UseSep", s);
+ }
+
+ DestroyCalc( &calc );
+ PostQuitMessage( 0 );
+ return 0;
+
+ case WM_KEYDOWN:
+ switch (wParam) {
+
+ case VK_F1:
+ calc.next = 1;
+ MessageBox(hWnd, "No Help Available", "Windows Help", MB_OK);
+ return 0;
+
+ case VK_F2: // DWORD
+
+ calc.next = 1;
+ if (!calc.sciMode) {
+ if (calc.numBase == NBASE_DECIMAL)
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_MS_DEGREES, lParam);
+ else
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_WS_DWORD, lParam);
+ }
+ return 0;
+
+ case VK_F3: // WORD
+
+ calc.next = 1;
+ if (!calc.sciMode) {
+ if (calc.numBase == NBASE_DECIMAL)
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_MS_RADIANS, lParam);
+ else
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_WS_WORD, lParam);
+ }
+ return 0;
+
+ case VK_F4: // Byte
+
+ // Grad
+ calc.next = 1;
+ if (!calc.sciMode) {
+ if (calc.numBase == NBASE_DECIMAL)
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_MS_GRADS, lParam);
+ else
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_WS_BYTE, lParam);
+ }
+ return 0;
+
+ case VK_F5: // Hex
+
+ calc.next = 1;
+ if (!calc.sciMode)
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_NS_HEX, lParam);
+ return 0;
+
+ case VK_F6: // Decimal
+
+ calc.next = 1;
+ if (!calc.sciMode)
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_NS_DEC, lParam);
+ return 0;
+
+ case VK_F7: // Octal
+
+ calc.next = 1;
+ if (!calc.sciMode)
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_NS_OCT, lParam);
+ return 0;
+
+ case VK_F8: // Binary
+
+ calc.next = 1;
+ if (!calc.sciMode)
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_NS_BIN, lParam);
+ return 0;
+
+ case VK_F12: // QWORD
+
+ calc.next = 1;
+ if (!calc.sciMode)
+ SendMessage(hWnd, WM_COMMAND, ID_CALC_WS_QWORD, lParam);
+ return 0;
+
+ case VK_F9: // +/-
+
+ if (!calc.sciMode)
+ SendMessage(hWnd, WM_CHAR, 'Z', lParam);
+ return 0;
+
+ case VK_INSERT: // Dat
+ calc.next = 1;
+ SendMessage(hWndListBox, LB_INSERTSTRING, -1, (LPARAM)calc.buffer);
+ InvalidateRect(hWndDlgStats, NULL, TRUE); // update list count at bottom edge of dialog
+ UpdateWindow(hWndDlgStats);
+ return 0;
+
+ case VK_DELETE:
+
+ calc.next = 1;
+ calc.buffer[0] = '\0';
+ calc_buffer_display(&calc);
+ return 0;
+
+ default:
+ break;
+ }
+
+ return 0;
+
+ case WM_CHAR:
+ if (debug)
+ show_debug(&calc, "Start WM_CHAR", wParam, lParam);
+
+ switch (wParam) {
+
+ case '\x13': // Ctrl+S Sta Statistics
+
+ if (hWndDlgStats) { // Statistics Box already displayed, focus but don't create another one
+ // SetFocus(hWndDlgStats);
+ // SendMessage(hWndDlgStats, WM_SETFOCUS, 0, 0);
+ }
+ else {
+ int i;
+
+ if (lParam == 1) {
+ for (i=0;i<4;i++)
+ EnableWindow((HWND)calc.cb[sta[i]].hBtn, FALSE);
+ }
+ else {
+ for (i=0;i<4;i++)
+ EnableWindow((HWND)calc.cb[sta[i]].hBtn, TRUE);
+
+ hWndDlgStats = CreateDialog( // modeless dialog
+ calc.hInst, // handle to application instance
+ "DLG_STATS", // identifies dialog box template name
+ hWnd, // handle to owner window
+ StatsDlgProc); // pointer to dialog box procedure
+
+ if (!hWndDlgStats)
+ exit(1);
+
+ SendMessage(hWndDlgStats, WM_SETFOCUS, 0, 0);
+ }
+ }
+
+ break;
+
+ case '\x01': // Ctrl+A Ave Statistics
+ case '\x04': // Ctrl+D s Standard Deviation Statistics
+ case '\x14': // Ctrl+T Sum Statistics
+ {
+ int i;
+ int n;
+
+ char s[CALC_BUF_SIZE];
+ double val = 0L;
+ double avg = 0L;
+ double total = 0L;
+ double x[1024];
+
+ // This is all lame. Here we are querying the list control for items and calculating the total.
+ // We should have an array of intermediate results to work with to avoid roundoff errors, etc.
+
+ n = SendMessage(hWndListBox, LB_GETCOUNT, 0, 0);
+
+ for (i=0;i<n;i++) {
+ SendMessage(hWndListBox, LB_GETTEXT, i, (LPARAM)s);
+ val = calc_atof(s,calc.numBase);
+ total += val;
+ x[i] = val;
+ }
+
+ if (LOWORD(wParam) != '\x14') // not sum only
+ avg = total / n;
+
+ if (LOWORD(wParam == '\x04')) { // standard deviation is sqrt(sum( xbar - x )^2 / (n-1))
+ val = 0L;
+
+ for (i=0;i<n;i++)
+ val += pow(x[i] - avg, 2);
+
+ if (calc.invMode)
+ total = sqrt(val / n); // complete population
+ else
+ total = sqrt(val / (n - 1)); // sample of population
+ }
+
+ if (LOWORD(wParam) == '\x01') // average or mean
+ total = avg;
+
+ calc_ftoa(&calc, total, s);
+ strcpy(calc.buffer, s);
+ calc_buffer_display(&calc);
+ }
+
+ break;
+
+ case '\x03': // Ctrl+C Copy
+ {
+ int i;
+ int len;
+ char *s;
+ HGLOBAL hGlobalMemory;
+ PSTR pGlobalMemory;
+
+ if (!(len = strlen(calc.display)))
+ return 0;
+
+ if (!(hGlobalMemory = GlobalAlloc(GHND, len + 1)))
+ return 0;
+
+ if (!(pGlobalMemory = GlobalLock(hGlobalMemory)))
+ return 0;
+
+ if (!(s = calc.display))
+ return 0;
+
+ for (i = 0; i < len; i++)
+ *pGlobalMemory++ = *s++;
+
+ GlobalUnlock(hGlobalMemory); // call GetLastError() for exception handling
+
+ if (!OpenClipboard(hWnd))
+ return 0;
+
+ if (!EmptyClipboard())
+ return 0;
+
+ if (!SetClipboardData(CF_TEXT, hGlobalMemory))
+ return 0;
+
+ if (!CloseClipboard())
+ return 0;
+ }
+ break;
+
+ case '\x16': // Ctrl+V Paste
+ {
+ char *s;
+ int c;
+ int cmd = 0;
+ int size = 0;
+ int i = 0;
+ HGLOBAL hGlobalMemory;
+ PSTR pGlobalMemory;
+
+ if (IsClipboardFormatAvailable(CF_TEXT)) {
+ if (!OpenClipboard(hWnd))
+ return 0;
+
+ if (!(hGlobalMemory = GetClipboardData(CF_TEXT)))
+ return 0;
+
+ if (!(size = GlobalSize(hGlobalMemory)))
+ return 0;
+
+ if (!(s = (char *)malloc(size)))
+ return 0;
+
+ if (!(pGlobalMemory = GlobalLock(hGlobalMemory)))
+ return 0;
+
+ strcpy(s, pGlobalMemory);
+
+ GlobalUnlock(hGlobalMemory);
+
+ if (!CloseClipboard())
+ return 0;
+
+ // calc paste protocol
+ //
+ // :c clear memory WM_CHAR, 0x0c
+ // :e enable scientific notation WM_CHAR, 'v'
+ // :m store display in memory WM_CHAR, 0x0d
+ // :p add display to memory WM_CHAR, 0x10
+ // :q clear current calculation WM_CHAR, '\x1b'
+ // :r read memory into display WM_CHAR, 0x12
+ // \ Dat WM_CHAR, VK_INSERT
+ //
+ // parse the pasted data, validate and SendMessage it one character at a time.
+ // it would appear wincalc does it this way (slow), although very slow appearing on Wine.
+
+ while ((c = *s++) && (i++ < size)) {
+ if (c == ':') {
+ cmd = 1;
+ }
+ else if (c == '\\') {
+ SendMessage(hWnd, WM_KEYDOWN, VK_INSERT, lParam);
+ }
+ else {
+ if (cmd) {
+ cmd = 0;
+
+ switch(c) {
+ case 'c': // clear memory
+
+ case 'C':
+ SendMessage(hWnd, WM_CHAR, 0x0c, lParam);
+ break;
+ case 'e': // enable scientific notation
+
+ case 'E':
+ SendMessage(hWnd, WM_CHAR, 'v', lParam);
+ break;
+ case 'm': // store display in memory
+
+ case 'M':
+ SendMessage(hWnd, WM_CHAR, 0x0d, NUMBER_OF_THE_BEAST);
+ break;
+ case 'p': // add display to memory
+
+ case 'P':
+ SendMessage(hWnd, WM_CHAR, 0x10, lParam);
+ break;
+ case 'q': // clear current calculation
+
+ case 'Q':
+ SendMessage(hWnd, WM_CHAR, '\x1b', lParam);
+ break;
+ case 'r': // read memory into display
+
+ case 'R':
+ SendMessage(hWnd, WM_CHAR, 0x12, lParam);
+ break;
+ default: // just eat it but complain
+
+ MessageBeep(0);
+ break;
+ }
+ }
+ else {
+ if ((calc.numBase == NBASE_HEX) &&
+ ((c >= '0' && c <= '9') ||
+ (c >= 'a' && c <= 'f') ||
+ (c >= 'A' && c <= 'F'))) {
+
+ SendMessage(hWnd, WM_CHAR, c, lParam);
+ }
+ else if ((calc.numBase == NBASE_DECIMAL) &&
+ (c >= '0' && c <= '9')) {
+ SendMessage(hWnd, WM_CHAR, c, lParam);
+ }
+ else if ((calc.numBase == NBASE_OCTAL) &&
+ (c >= '0' && c <= '7')) {
+ SendMessage(hWnd, WM_CHAR, c, lParam);
+ }
+ else if ((calc.numBase == NBASE_BINARY) &&
+ (c == '0' || c == '1')) {
+ SendMessage(hWnd, WM_CHAR, c, lParam);
+ }
+ else if (c == '.' || c == ',' ||
+ c == 'e' || c == 'E' ||
+ c == '+' || c == '-') {
+ SendMessage(hWnd, WM_CHAR, c, lParam);
+ }
+ else if (c == ' ' || // eat harmless trash here
+ c == ';' ||
+ c == ':') {
+ ; // noop
+ }
+ else { // extra spicy trash gets noticed
+
+ MessageBeep(0); // uh, beeps can get annoying. maybe rate limit.
+ }
+ }
+ }
+ }
+ }
+ }
+
+ break;
+ default:
+ {
+ int ret = parse(wParam, lParam);
+ }
+ } // switch WM_CHAR
+
+ calc_buffer_display(&calc);
+ return 0;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+
+ case IDM_COPY:
+ SendMessage(hWnd, WM_CHAR, '\x03', lParam);
+ return 0;
+
+ case IDM_PASTE:
+ SendMessage(hWnd, WM_CHAR, '\x16', lParam);
+ return 0;
+
+ case IDM_MODE_STANDARD:
+ if (!calc.sciMode) {
+ int i;
+ RECT lpRect;
+
+ calc.sciMode = 1;
+ calc.trigMode = TRIGMODE_DEGREES;
+ calc.numBase = NBASE_DECIMAL;
+
+ EnableWindow(hWnd, FALSE);
+
+
+ for (i=1;i<COUNT_MENUS;i++) {
+ if (calc.numBase != ID_CALC_NS_DEC) {
+ CheckMenuItem(menus[i], ID_CALC_NS_HEX, MF_UNCHECKED);
+ CheckMenuItem(menus[i], ID_CALC_NS_DEC, MF_CHECKED);
+ CheckMenuItem(menus[i], ID_CALC_NS_OCT, MF_UNCHECKED);
+ CheckMenuItem(menus[i], ID_CALC_NS_BIN, MF_UNCHECKED);
+ }
+ }
+
+ for (i=1;i<COUNT_MENUS;i++) {
+ CheckMenuItem(menus[i], ID_CALC_MS_DEGREES, MF_CHECKED);
+ CheckMenuItem(menus[i], ID_CALC_MS_RADIANS, MF_UNCHECKED);
+ CheckMenuItem(menus[i], ID_CALC_MS_GRADS, MF_UNCHECKED);
+ }
+
+ SetMenu(hWnd, menus[MENU_STD]);
+
+ // SendMessage(hWnd, WM_SIZE, SIZE_RESTORED, CALC_STANDARD_WIDTH | (CALC_STANDARD_HEIGHT << 8));
+ GetWindowRect(hWnd, &lpRect);
+ MoveWindow(hWnd, lpRect.left, lpRect.top, CALC_STANDARD_WIDTH, CALC_STANDARD_HEIGHT, TRUE);
+ DestroyCalc(&calc);
+ InitCalc(&calc);
+
+ EnableWindow(hWnd, TRUE);
+
+ }
+ return 0;
+
+ case IDM_MODE_SCIENTIFIC:
+ if (calc.sciMode) {
+ RECT lpRect;
+ calc.sciMode = 0;
+
+ EnableWindow(hWnd, FALSE);
+
+ SetMenu(hWnd, menus[MENU_SCIMS]);
+
+ GetWindowRect(hWnd, &lpRect);
+ MoveWindow(hWnd, lpRect.left, lpRect.top, CALC_SCIENTIFIC_WIDTH, CALC_SCIENTIFIC_HEIGHT, TRUE);
+ DestroyCalc(&calc);
+ InitCalc(&calc);
+
+ if (calc.invMode)
+ SendMessage(calc.cb[67].hBtn, BM_SETCHECK, TRUE, 0);
+
+ if (calc.hypMode)
+ SendMessage(calc.cb[68].hBtn, BM_SETCHECK, TRUE, 0);
+
+ EnableWindow(hWnd, TRUE);
+
+ }
+ return 0;
+
+ case IDM_DIGIT_GROUPING:
+ {
+ int i;
+ int n;
+
+ calc.digitGrouping = !calc.digitGrouping;
+
+ n = (calc.digitGrouping ? MF_CHECKED : MF_UNCHECKED);
+
+ for (i=0;i<COUNT_MENUS;i++)
+ CheckMenuItem(menus[i], IDM_DIGIT_GROUPING, n);
+
+ calc_buffer_display(&calc);
+ }
+ return 0;
+
+ case IDM_HELP_TOPICS:
+ MessageBox(hWnd, "No Help Available", "Windows Help", MB_OK);
+ return 0;
+
+ case IDM_ABOUT:
+ DialogBox( calc.hInst, "DLG_ABOUT", hWnd, AboutDlgProc );
+ return 0;
+
+ case ID_CALC_NS_HEX:
+ case ID_CALC_NS_DEC:
+ case ID_CALC_NS_OCT:
+ case ID_CALC_NS_BIN:
+ {
+ int i;
+ int w = LOWORD(wParam);
+
+ if (w == ID_CALC_NS_HEX) {
+ if (calc.numBase == NBASE_HEX)
+ return 0;
+ else
+ calc.numBase = NBASE_HEX;
+ }
+ else if (w == ID_CALC_NS_DEC) {
+ if (calc.numBase == NBASE_DECIMAL)
+ return 0;
+ else
+ calc.numBase = NBASE_DECIMAL;
+ }
+ else if (w == ID_CALC_NS_OCT) {
+ if (calc.numBase == NBASE_OCTAL)
+ return 0;
+ else
+ calc.numBase = NBASE_OCTAL;
+ }
+ else if (w == ID_CALC_NS_BIN) {
+ if (calc.numBase == NBASE_BINARY)
+ return 0;
+ else
+ calc.numBase = NBASE_BINARY;
+ }
+
+ for (i=0;i<CALC_NS_COUNT;i++)
+ SendMessage(calc.cb[60+i].hBtn, BM_SETCHECK, w == (ID_CALC_NS_HEX + i) ? 1 : 0, 0);
+
+ for (i=2;i<TOGGLE_COUNT;i++) { // skip 0 and 1, always valid
+ if (btn_toggle[w - ID_CALC_NS_HEX ][i]) {
+ if (!IsWindowEnabled((HWND)calc.cb[h[i]].hBtn))
+ EnableWindow((HWND)calc.cb[h[i]].hBtn, TRUE);
+
+ }
+ else {
+ if (IsWindowEnabled((HWND)calc.cb[h[i]].hBtn))
+ EnableWindow((HWND)calc.cb[h[i]].hBtn, FALSE);
+ }
+ }
+
+ if (w == ID_CALC_NS_DEC) {
+ for (i=0;i<CALC_WS_COUNT;i++) {
+ if (IsWindowEnabled((HWND)calc.cb[hws[i]].hBtn)) {
+ ShowWindow((HWND)calc.cb[hws[i]].hBtn, SW_HIDE);
+ EnableWindow((HWND)calc.cb[hws[i]].hBtn, FALSE);
+ }
+ }
+ for (i=0;i<CALC_MS_COUNT;i++) {
+ if (!IsWindowEnabled((HWND)calc.cb[hms[i]].hBtn)) {
+ ShowWindow((HWND)calc.cb[hms[i]].hBtn, SW_SHOWNORMAL);
+ EnableWindow((HWND)calc.cb[hms[i]].hBtn, TRUE);
+ }
+ }
+ }
+ else {
+ for (i=0;i<CALC_MS_COUNT;i++) {
+ if (IsWindowEnabled((HWND)calc.cb[hms[i]].hBtn)) {
+ ShowWindow((HWND)calc.cb[hms[i]].hBtn, SW_HIDE);
+ EnableWindow((HWND)calc.cb[hms[i]].hBtn, FALSE);
+ }
+ }
+ for (i=0;i<CALC_WS_COUNT;i++) {
+ if (!IsWindowEnabled((HWND)calc.cb[hws[i]].hBtn)) {
+ ShowWindow((HWND)calc.cb[hws[i]].hBtn, SW_SHOWNORMAL);
+ EnableWindow((HWND)calc.cb[hws[i]].hBtn, TRUE);
+ }
+ }
+ }
+
+ CheckMenuItem(menus[i], ID_CALC_MS_DEGREES, MF_CHECKED);
+
+ for (i=1;i<COUNT_MENUS;i++) { // skip the simple Standard calculator mode
+ CheckMenuItem(menus[i], ID_CALC_NS_HEX, (w == ID_CALC_NS_HEX ? MF_CHECKED : MF_UNCHECKED) );
+ CheckMenuItem(menus[i], ID_CALC_NS_DEC, (w == ID_CALC_NS_DEC ? MF_CHECKED : MF_UNCHECKED) );
+ CheckMenuItem(menus[i], ID_CALC_NS_OCT, (w == ID_CALC_NS_OCT ? MF_CHECKED : MF_UNCHECKED) );
+ CheckMenuItem(menus[i], ID_CALC_NS_BIN, (w == ID_CALC_NS_BIN ? MF_CHECKED : MF_UNCHECKED) );
+ }
+
+ if (wParam == ID_CALC_NS_DEC) {
+ SetMenu(hWnd, menus[MENU_SCIMS]);
+
+ }
+ else {
+ calc.displayMode = 0;
+ SetMenu(hWnd, menus[MENU_SCIWS]);
+ }
+ }
+ calc_buffer_display(&calc);
+
+ break;
+
+ case ID_CALC_MS_DEGREES:
+ case ID_CALC_MS_RADIANS:
+ case ID_CALC_MS_GRADS:
+ {
+ int i;
+ int w = LOWORD(wParam);
+
+ if (w == ID_CALC_MS_DEGREES)
+ calc.trigMode = TRIGMODE_DEGREES;
+ else if (w == ID_CALC_MS_RADIANS)
+ calc.trigMode = TRIGMODE_RADIANS;
+ else if (w == ID_CALC_MS_GRADS)
+ calc.trigMode = TRIGMODE_GRADS;
+ else
+ return 0;
+
+ for (i=0;i<CALC_MS_COUNT;i++)
+ SendMessage(calc.cb[64+i].hBtn, BM_SETCHECK, w == (ID_CALC_MS_DEGREES + i) ? 1 : 0, 0);
+
+ for (i=1;i<COUNT_MENUS;i++) { // skip the simple Standard calculator mode
+ CheckMenuItem(menus[i], ID_CALC_MS_DEGREES, (wParam == ID_CALC_MS_DEGREES) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(menus[i], ID_CALC_MS_RADIANS, (wParam == ID_CALC_MS_RADIANS) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(menus[i], ID_CALC_MS_GRADS, (wParam == ID_CALC_MS_GRADS) ? MF_CHECKED : MF_UNCHECKED);
+ }
+ }
+
+ SetFocus(hWnd);
+ return 0;
+
+ case ID_CALC_WS_QWORD:
+ case ID_CALC_WS_DWORD:
+ case ID_CALC_WS_WORD:
+ case ID_CALC_WS_BYTE:
+ {
+ int i;
+ int w = LOWORD(wParam);
+
+ calc.wordSize = w;
+
+ for (i=0;i<CALC_WS_COUNT;i++)
+ SendMessage(calc.cb[69+i].hBtn, BM_SETCHECK, LOWORD(wParam) == (ID_CALC_WS_QWORD + i) ? 1 : 0, 0);
+
+ for (i=1; i<COUNT_MENUS; i++) { // skip the simple Standard calculator mode
+ CheckMenuItem(menus[i], ID_CALC_WS_QWORD, (w == ID_CALC_WS_QWORD ? MF_CHECKED : MF_UNCHECKED) );
+ CheckMenuItem(menus[i], ID_CALC_WS_DWORD, (w == ID_CALC_WS_DWORD ? MF_CHECKED : MF_UNCHECKED) );
+ CheckMenuItem(menus[i], ID_CALC_WS_WORD, (w == ID_CALC_WS_WORD ? MF_CHECKED : MF_UNCHECKED) );
+ CheckMenuItem(menus[i], ID_CALC_WS_BYTE, (w == ID_CALC_WS_BYTE ? MF_CHECKED : MF_UNCHECKED) );
+ }
+ }
+
+ SetFocus(hWnd);
+ return 0;
+
+ case ID_CALC_CB_INV:
+ if (calc.invMode)
+ calc.invMode = 0;
+ else
+ calc.invMode = 1;
+
+ SendMessage(calc.cb[67].hBtn, BM_SETCHECK, calc.invMode ? TRUE : FALSE, 0);
+ SetFocus(hWnd);
+ return 0;
+
+ case ID_CALC_CB_HYP:
+ if (calc.hypMode)
+ calc.hypMode = 0;
+ else
+ calc.hypMode = 1;
+
+ SendMessage(calc.cb[68].hBtn, BM_SETCHECK, calc.hypMode ? TRUE : FALSE, 0);
+ SetFocus(hWnd);
+ return 0;
+
+ default:
+ if (HIWORD(wParam) == BN_CLICKED) {
+
+ if (calc.err &&
+ LOWORD(wParam) != ID_CALC_CLEAR_ENTRY &&
+ LOWORD(wParam) != ID_CALC_CLEAR_ALL) {
+
+ MessageBeep(0);
+ return 0;
+ }
+ else {
+ calc.err = 0;
+ }
+
+ switch (LOWORD(wParam)) {
+
+ case ID_CALC_ZERO:
+ case ID_CALC_ONE:
+ case ID_CALC_TWO:
+ case ID_CALC_THREE:
+ case ID_CALC_FOUR:
+ case ID_CALC_FIVE:
+ case ID_CALC_SIX:
+ case ID_CALC_SEVEN:
+ case ID_CALC_EIGHT:
+ case ID_CALC_NINE:
+ SendMessage(hWnd, WM_CHAR, LOWORD(wParam)+'0' , lParam);
+ break;
+
+ case ID_CALC_A:
+ SendMessage(hWnd, WM_CHAR, 'a', lParam);
+ break;
+
+ case ID_CALC_B:
+ SendMessage(hWnd, WM_CHAR, 'b', lParam);
+ break;
+
+ case ID_CALC_C:
+ SendMessage(hWnd, WM_CHAR, 'c', lParam);
+ break;
+
+ case ID_CALC_D:
+ SendMessage(hWnd, WM_CHAR, 'd', lParam);
+ break;
+
+ case ID_CALC_E:
+ SendMessage(hWnd, WM_CHAR, 'e', lParam);
+ break;
+
+ case ID_CALC_F:
+ SendMessage(hWnd, WM_CHAR, 'f', lParam);
+ break;
+
+ case ID_CALC_DECIMAL:
+ SendMessage(hWnd, WM_CHAR, '.', lParam);
+ break;
+
+ case ID_CALC_BACKSPACE:
+ SendMessage(hWnd, WM_CHAR, '\b', lParam);
+ break;
+
+ case ID_CALC_CLEAR_ENTRY:
+ SendMessage(hWnd, WM_KEYDOWN, VK_DELETE , lParam);
+ break;
+
+ case ID_CALC_CLEAR_ALL:
+ SendMessage(hWnd, WM_CHAR, '\x1b', lParam);
+ break;
+
+ case ID_CALC_MEM_CLEAR:
+ SendMessage(hWnd, WM_CHAR, 0x0c, lParam);
+ break;
+
+ case ID_CALC_MEM_RECALL:
+ SendMessage(hWnd, WM_CHAR, 0x12, lParam);
+ break;
[truncated at 1000 lines; 2789 more skipped]
reactos/subsys/system/calc
diff -N winecalc.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ winecalc.h 21 Nov 2004 21:02:03 -0000 1.1
@@ -0,0 +1,364 @@
+/*
+ * 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);
+
reactos/subsys/system/regedt32
diff -N .cvsignore
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ .cvsignore 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,17 @@
+*.sys
+*.exe
+*.dll
+*.cpl
+*.a
+*.o
+*.d
+*.coff
+*.dsp
+*.dsw
+*.aps
+*.ncb
+*.opt
+*.sym
+*.plg
+*.bak
+*.map
reactos/subsys/system/regedt32
diff -N Makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Makefile 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,36 @@
+PATH_TO_TOP = ../../..
+
+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
reactos/subsys/system/regedt32
diff -N StdAfx.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ StdAfx.cpp 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,8 @@
+// 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
reactos/subsys/system/regedt32
diff -N StdAfx.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ StdAfx.h 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,32 @@
+// 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_)
reactos/subsys/system/regedt32
diff -N childwnd.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ childwnd.c 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,285 @@
+/*
+ * 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;
+}
reactos/subsys/system/regedt32
diff -N childwnd.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ childwnd.h 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,42 @@
+/*
+ * 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__
reactos/subsys/system/regedt32
diff -N framewnd.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ framewnd.c 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,567 @@
+/*
+ * 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;
+}
+
+
reactos/subsys/system/regedt32
diff -N framewnd.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ framewnd.h 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,46 @@
+/*
+ * 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__
reactos/subsys/system/regedt32
diff -N listview.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ listview.c 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,363 @@
+/*
+ * ReactOS regedit
+ *
+ * listview.c
+ *
+ * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifdef _MSC_VER
+#include "stdafx.h"
+#else
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#include <windows.h>
+#include <commctrl.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include <memory.h>
+#include <tchar.h>
+#include <process.h>
+#include <stdio.h>
+#endif
+
+#include <windowsx.h>
+#include "main.h"
+#include "listview.h"
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Global and Local Variables:
+//
+
+static WNDPROC g_orgListWndProc;
+
+#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
+static int default_column_widths[MAX_LIST_COLUMNS] = { 200, 175, 400 };
+static int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT };
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Local module support methods
+//
+
+static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValBuf, DWORD dwCount)
+{
+ LVITEM item;
+
+ item.mask = LVIF_TEXT | LVIF_PARAM;
+ item.iItem = 0;//idx;
+ item.iSubItem = 0;
+ item.state = 0;
+ item.stateMask = 0;
+ item.pszText = Name;
+ item.cchTextMax = _tcslen(item.pszText);
+ item.iImage = 0;
+ item.lParam = (LPARAM)dwValType;
+// item.lParam = (LPARAM)ValBuf;
+#if (_WIN32_IE >= 0x0300)
+ item.iIndent = 0;
+#endif
+ ListView_InsertItem(hwndLV, &item);
+}
+
+static void CreateListColumns(HWND hWndListView)
+{
+ TCHAR szText[50];
+ int index;
+ LV_COLUMN lvC;
+
+ // Create columns.
+ lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+ lvC.pszText = szText;
+
+ // Load the column labels from the resource file.
+ for (index = 0; index < MAX_LIST_COLUMNS; index++) {
+ lvC.iSubItem = index;
+ lvC.cx = default_column_widths[index];
+ lvC.fmt = column_alignment[index];
+ LoadString(hInst, IDS_LIST_COLUMN_FIRST + index, szText, sizeof(szText)/sizeof(TCHAR));
+ if (ListView_InsertColumn(hWndListView, index, &lvC) == -1) {
+ // TODO: handle failure condition...
+ break;
+ }
+ }
+}
+
+// OnGetDispInfo - processes the LVN_GETDISPINFO notification message.
+
+static void OnGetDispInfo(NMLVDISPINFO* plvdi)
+{
+ static TCHAR buffer[200];
+
+ plvdi->item.pszText = NULL;
+ plvdi->item.cchTextMax = 0;
+
+ switch (plvdi->item.iSubItem) {
+ case 0:
+ plvdi->item.pszText = _T("(Default)");
+ break;
+ case 1:
+ switch (plvdi->item.lParam) {
+ case REG_SZ:
+ plvdi->item.pszText = _T("REG_SZ");
+ break;
+ case REG_EXPAND_SZ:
+ plvdi->item.pszText = _T("REG_EXPAND_SZ");
+ break;
+ case REG_BINARY:
+ plvdi->item.pszText = _T("REG_BINARY");
+ break;
+ case REG_DWORD:
+ plvdi->item.pszText = _T("REG_DWORD");
+ break;
+// case REG_DWORD_LITTLE_ENDIAN:
+// plvdi->item.pszText = _T("REG_DWORD_LITTLE_ENDIAN");
+// break;
+ case REG_DWORD_BIG_ENDIAN:
+ plvdi->item.pszText = _T("REG_DWORD_BIG_ENDIAN");
+ break;
+ case REG_MULTI_SZ:
+ plvdi->item.pszText = _T("REG_MULTI_SZ");
+ break;
+ case REG_LINK:
+ plvdi->item.pszText = _T("REG_LINK");
+ break;
+ case REG_RESOURCE_LIST:
+ plvdi->item.pszText = _T("REG_RESOURCE_LIST");
+ break;
+ case REG_NONE:
+ plvdi->item.pszText = _T("REG_NONE");
+ break;
+ default:
+ wsprintf(buffer, _T("unknown(%d)"), plvdi->item.lParam);
+ plvdi->item.pszText = buffer;
+ break;
+ }
+ break;
+ case 2:
+ plvdi->item.pszText = _T("(value not set)");
+ break;
+ case 3:
+ plvdi->item.pszText = _T("");
+ break;
+ }
+}
+
+static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
+{
+ TCHAR buf1[1000];
+ TCHAR buf2[1000];
+
+ ListView_GetItemText((HWND)lParamSort, lParam1, 0, buf1, sizeof(buf1));
+ ListView_GetItemText((HWND)lParamSort, lParam2, 0, buf2, sizeof(buf2));
+ return _tcscmp(buf1, buf2);
+}
+
+static void ListViewPopUpMenu(HWND hWnd, POINT pt)
+{
+}
+
+static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch (LOWORD(wParam)) {
+// case ID_FILE_OPEN:
+// break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch (message) {
+ case WM_COMMAND:
+ if (!_CmdWndProc(hWnd, message, wParam, lParam)) {
+ return CallWindowProc(g_orgListWndProc, hWnd, message, wParam, lParam);
+ }
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case LVN_GETDISPINFO:
+ OnGetDispInfo((NMLVDISPINFO*)lParam);
+ break;
+ case NM_DBLCLK:
+ {
+ NMITEMACTIVATE* nmitem = (LPNMITEMACTIVATE)lParam;
+ LVHITTESTINFO info;
+
+ if (nmitem->hdr.hwndFrom != hWnd) break;
+// if (nmitem->hdr.idFrom != IDW_LISTVIEW) break;
+// if (nmitem->hdr.code != ???) break;
+#ifdef _MSC_VER
+ switch (nmitem->uKeyFlags) {
+ case LVKF_ALT: // The ALT key is pressed.
+ // properties dialog box ?
+ break;
+ case LVKF_CONTROL: // The CTRL key is pressed.
+ // run dialog box for providing parameters...
+ break;
+ case LVKF_SHIFT: // The SHIFT key is pressed.
+ break;
+ }
+#endif
+ info.pt.x = nmitem->ptAction.x;
+ info.pt.y = nmitem->ptAction.y;
+ if (ListView_HitTest(hWnd, &info) != -1) {
+ LVITEM item;
+ item.mask = LVIF_PARAM;
+ item.iItem = info.iItem;
+ if (ListView_GetItem(hWnd, &item)) {
+ }
+ }
+ }
+ break;
+
+ case NM_RCLICK:
+ {
+ int idx;
+ LV_HITTESTINFO lvH;
+ NM_LISTVIEW* pNm = (NM_LISTVIEW*)lParam;
+ lvH.pt.x = pNm->ptAction.x;
+ lvH.pt.y = pNm->ptAction.y;
+ idx = ListView_HitTest(hWnd, &lvH);
+ if (idx != -1) {
+ POINT pt;
+ GetCursorPos(&pt);
+ ListViewPopUpMenu(hWnd, pt);
+ return idx;
+ }
+ }
+ break;
+
+ default:
+ return CallWindowProc(g_orgListWndProc, hWnd, message, wParam, lParam);
+ }
+ break;
+ case WM_KEYDOWN:
+ if (wParam == VK_TAB) {
+ //TODO: SetFocus(Globals.hDriveBar)
+ //SetFocus(child->nFocusPanel? child->left.hWnd: child->right.hWnd);
+ }
+ // fall thru...
+ default:
+ return CallWindowProc(g_orgListWndProc, hWnd, message, wParam, lParam);
+ break;
+ }
+ return 0;
+}
+
+
+HWND CreateListView(HWND hwndParent)
+{
+ RECT rcClient;
+ HWND hwndLV;
+
+ // Get the dimensions of the parent window's client area, and create the list view control.
+ GetClientRect(hwndParent, &rcClient);
+ hwndLV = CreateWindowEx(0, WC_LISTVIEW, _T("List View"),
+ WS_VISIBLE | WS_CHILD | WS_EX_CLIENTEDGE | LVS_REPORT,
+ 0, 0, rcClient.right, rcClient.bottom,
+ hwndParent, (HMENU)LIST_WINDOW, hInst, NULL);
+ ListView_SetExtendedListViewStyle(hwndLV, LVS_EX_FULLROWSELECT);
+
+ // Initialize the image list, and add items to the control.
+/*
+ if (!InitListViewImageLists(hwndLV) ||
+ !InitListViewItems(hwndLV, szName)) {
+ DestroyWindow(hwndLV);
+ return FALSE;
+ }
+ */
+ CreateListColumns(hwndLV);
+ g_orgListWndProc = SubclassWindow(hwndLV, ListWndProc);
+ return hwndLV;
+}
+
+BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPTSTR keyPath)
+{
+ if (hwndLV != NULL) {
+ ListView_DeleteAllItems(hwndLV);
+ }
+
+ if (hKey != NULL) {
+ LONG errCode;
+ HKEY hNewKey;
+
+
+ DWORD max_sub_key_len;
+ DWORD max_val_name_len;
+ DWORD max_val_size;
+ DWORD val_count;
+ errCode = RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL,
+ &max_sub_key_len, NULL, &val_count, &max_val_name_len, &max_val_size, NULL, NULL);
+ if (errCode == ERROR_SUCCESS) {
+ TCHAR* ValName = malloc(++max_val_name_len * sizeof(TCHAR));
+ DWORD dwValNameLen = max_val_name_len;
+ BYTE* ValBuf = malloc(++max_val_size);
+ DWORD dwValSize = max_val_size;
+ DWORD dwIndex = 0L;
+ DWORD dwValType;
+ while (RegEnumValue(hKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS) {
+ AddEntryToList(hwndLV, ValName, dwValType, ValBuf, dwIndex);
+ dwValNameLen = max_val_name_len;
+ dwValSize = max_val_size;
+ dwValType = 0L;
+ ++dwIndex;
+ }
+ free(ValBuf);
+ free(ValName);
+ }
+
+
+ errCode = RegOpenKeyEx(hKey, keyPath, 0, KEY_READ, &hNewKey);
+ if (errCode == ERROR_SUCCESS) {
+ DWORD max_sub_key_len;
+ DWORD max_val_name_len;
+ DWORD max_val_size;
+ DWORD val_count;
+ ShowWindow(hwndLV, SW_HIDE);
+ /* get size information and resize the buffers if necessary */
+ errCode = RegQueryInfoKey(hNewKey, NULL, NULL, NULL, NULL,
+ &max_sub_key_len, NULL, &val_count, &max_val_name_len, &max_val_size, NULL, NULL);
+ if (errCode == ERROR_SUCCESS) {
+ TCHAR* ValName = malloc(++max_val_name_len * sizeof(TCHAR));
+ DWORD dwValNameLen = max_val_name_len;
+ BYTE* ValBuf = malloc(++max_val_size);
+ DWORD dwValSize = max_val_size;
+ DWORD dwIndex = 0L;
+ DWORD dwValType;
+ while (RegEnumValue(hNewKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS) {
+ //while (RegEnumValue(hNewKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, NULL, NULL) == ERROR_SUCCESS) {
+ AddEntryToList(hwndLV, ValName, dwValType, ValBuf, dwIndex);
+ dwValNameLen = max_val_name_len;
+ dwValSize = max_val_size;
+ dwValType = 0L;
+ ++dwIndex;
+ }
+ free(ValBuf);
+ free(ValName);
+ }
+ //ListView_SortItemsEx(hwndLV, CompareFunc, hwndLV);
+// SendMessage(hwndLV, LVM_SORTITEMSEX, (WPARAM)CompareFunc, (LPARAM)hwndLV);
+ ShowWindow(hwndLV, SW_SHOW);
+ RegCloseKey(hNewKey);
+ }
+ }
+ return TRUE;
+}
+
reactos/subsys/system/regedt32
diff -N listview.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ listview.h 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * 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__
reactos/subsys/system/regedt32
diff -N main.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ main.c 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,181 @@
+/*
+ * 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;
+}
reactos/subsys/system/regedt32
diff -N main.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ main.h 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,111 @@
+/*
+ * 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__
reactos/subsys/system/regedt32
diff -N regedt32.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ regedt32.rc 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,261 @@
+/* $Id: regedt32.rc,v 1.1 2004/11/21 21:02:04 chorns 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
+
reactos/subsys/system/regedt32
diff -N resource.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ resource.h 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,112 @@
+//{{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
reactos/subsys/system/regedt32
diff -N settings.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ settings.c 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,126 @@
+/*
+ * 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);
+}
reactos/subsys/system/regedt32
diff -N settings.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ settings.h 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * 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__
reactos/subsys/system/regedt32
diff -N treeview.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ treeview.c 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,259 @@
+/*
+ * 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;
+}
reactos/subsys/system/regedt32
diff -N treeview.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ treeview.h 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,44 @@
+/*
+ * 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__
reactos/subsys/system/regsvr32
diff -N .cvsignore
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ .cvsignore 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,17 @@
+*.sys
+*.exe
+*.dll
+*.cpl
+*.a
+*.o
+*.d
+*.coff
+*.dsp
+*.dsw
+*.aps
+*.ncb
+*.opt
+*.sym
+*.plg
+*.bak
+*.map
reactos/subsys/system/regsvr32
diff -N makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ makefile 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,17 @@
+PATH_TO_TOP = ../../..
+
+TARGET_NORC = yes
+
+TARGET_TYPE = program
+
+TARGET_APPTYPE = console
+
+TARGET_NAME = regsvr32
+
+TARGET_CFLAGS = -D__USE_W32API
+
+TARGET_OBJECTS = $(TARGET_NAME).o
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk
reactos/subsys/system/regsvr32
diff -N regsvr32.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ regsvr32.c 21 Nov 2004 21:02:04 -0000 1.1
@@ -0,0 +1,172 @@
+/*
+ * 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;
+}
CVSspam 0.2.8