Index: win/tclWinReg.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinReg.c,v
retrieving revision 1.17
diff -u -r1.17 tclWinReg.c
--- win/tclWinReg.c	29 Jan 2002 03:18:46 -0000	1.17
+++ win/tclWinReg.c	18 Oct 2002 23:53:14 -0000
@@ -159,6 +159,8 @@
  */
 
 static void		AppendSystemError(Tcl_Interp *interp, DWORD error);
+static int		BroadcastValue(Tcl_Interp *interp, int objc,
+			    Tcl_Obj * CONST objv[]);
 static DWORD		ConvertDWORD(DWORD type, DWORD value);
 static int		DeleteKey(Tcl_Interp *interp, Tcl_Obj *keyNameObj);
 static int		DeleteValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj,
@@ -256,9 +258,12 @@
     char *errString;
 
     static CONST char *subcommands[] = {
-	"delete", "get", "keys", "set", "type", "values", (char *) NULL
+	"broadcast", "delete", "get", "keys", "set", "type", "values",
+	(char *) NULL
+    };
+    enum SubCmdIdx {
+	BroadcastIdx, DeleteIdx, GetIdx, KeysIdx, SetIdx, TypeIdx, ValuesIdx
     };
-    enum SubCmdIdx { DeleteIdx, GetIdx, KeysIdx, SetIdx, TypeIdx, ValuesIdx };
 
     if (objc < 2) {
 	Tcl_WrongNumArgs(interp, objc, objv, "option ?arg arg ...?");
@@ -271,6 +276,9 @@
     }
 
     switch (index) {
+	case BroadcastIdx:		/* broadcast */
+	    return BroadcastValue(interp, objc, objv);
+	    break;
 	case DeleteIdx:			/* delete */
 	    if (objc == 3) {
 		return DeleteKey(interp, objv[2]);
@@ -1293,6 +1301,71 @@
 	AppendSystemError(interp, result);
 	return TCL_ERROR;
     }
+    return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * BroadcastValue --
+ *
+ *	This function broadcasts a WM_SETTINGCHANGE message to indicate
+ *	to other programs that we have changed the contents of a registry
+ *	value.
+ *
+ * Results:
+ *	Returns a normal Tcl result.
+ *
+ * Side effects:
+ *	Will cause other programs to reload their system settings.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+BroadcastValue(
+    Tcl_Interp *interp,		/* Current interpreter. */
+    int objc,			/* Number of arguments. */
+    Tcl_Obj * CONST objv[])	/* Argument values. */
+{
+    DWORD result, sendResult;
+    UINT timeout = 3000;
+    int len;
+    char *str;
+    Tcl_Obj *objPtr;
+
+    if ((objc != 3) && (objc != 5)) {
+	Tcl_WrongNumArgs(interp, 2, objv, "keyName ?-timeout millisecs?");
+	return TCL_ERROR;
+    }
+
+    if (objc > 3) {
+	str = Tcl_GetStringFromObj(objv[3], &len);
+	if ((len < 2) || (*str != '-') || strncmp(str, "-timeout", len)) {
+	    Tcl_WrongNumArgs(interp, 2, objv, "keyName ?-timeout millisecs?");
+	    return TCL_ERROR;
+	}
+	if (Tcl_GetIntFromObj(interp, objv[4], (int *) &timeout) != TCL_OK) {
+	    return TCL_ERROR;
+	}
+    }
+
+    str = Tcl_GetStringFromObj(objv[2], &len);
+    if (len = 0) {
+	str = NULL;
+    }
+
+    /*
+     * Use the ignore the result.
+     */
+    result = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE,
+	    (WPARAM) 0, (LPARAM) str, SMTO_ABORTIFHUNG, timeout, &sendResult);
+
+    objPtr = Tcl_NewObj();
+    Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewIntObj(result));
+    Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewIntObj(sendResult));
+    Tcl_SetObjResult(interp, objPtr);
+
     return TCL_OK;
 }
 
Index: win/configure.in
===================================================================
RCS file: /cvsroot/tcl/tcl/win/configure.in,v
retrieving revision 1.56
diff -u -r1.56 configure.in
--- win/configure.in	27 Sep 2002 18:04:14 -0000	1.56
+++ win/configure.in	18 Oct 2002 23:53:14 -0000
@@ -20,9 +20,9 @@
 TCL_DDE_PATCH_LEVEL=""
 DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION
 
-TCL_REG_VERSION=1.0
+TCL_REG_VERSION=1.1
 TCL_REG_MAJOR_VERSION=1
-TCL_REG_MINOR_VERSION=0
+TCL_REG_MINOR_VERSION=1
 TCL_REG_PATCH_LEVEL=""
 REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION
 
Index: win/Makefile.in
===================================================================
RCS file: /cvsroot/tcl/tcl/win/Makefile.in,v
retrieving revision 1.65
diff -u -r1.65 Makefile.in
--- win/Makefile.in	22 Aug 2002 00:52:33 -0000	1.65
+++ win/Makefile.in	18 Oct 2002 23:53:14 -0000
@@ -433,7 +433,7 @@
 		else true; \
 		fi; \
 	    done;
-	@for i in dde1.2 reg1.0; \
+	@for i in dde1.2 reg1.1; \
 	    do \
 	    if [ ! -d $(LIB_INSTALL_DIR)/$$i ] ; then \
 		echo "Making directory $(LIB_INSTALL_DIR)/$$i"; \
@@ -467,13 +467,13 @@
 	    fi
 	@if [ -f $(REG_DLL_FILE) ]; then \
 	    echo installing $(REG_DLL_FILE); \
-	    $(COPY) $(REG_DLL_FILE) $(LIB_INSTALL_DIR)/reg1.0; \
+	    $(COPY) $(REG_DLL_FILE) $(LIB_INSTALL_DIR)/reg1.1; \
 	    $(COPY) $(ROOT_DIR)/library/reg/pkgIndex.tcl \
-		$(LIB_INSTALL_DIR)/reg1.0; \
+		$(LIB_INSTALL_DIR)/reg1.1; \
 	    fi
 	@if [ -f $(REG_LIB_FILE) ]; then \
 	    echo installing $(REG_LIB_FILE); \
-	    $(COPY) $(REG_LIB_FILE) $(LIB_INSTALL_DIR)/reg1.0; \
+	    $(COPY) $(REG_LIB_FILE) $(LIB_INSTALL_DIR)/reg1.1; \
 	    fi
 
 install-libraries: libraries
Index: win/makefile.vc
===================================================================
RCS file: /cvsroot/tcl/tcl/win/makefile.vc,v
retrieving revision 1.93
diff -u -r1.93 makefile.vc
--- win/makefile.vc	29 Sep 2002 20:41:16 -0000	1.93
+++ win/makefile.vc	18 Oct 2002 23:53:14 -0000
@@ -160,7 +160,7 @@
 DDEDOTVERSION = 1.2
 DDEVERSION = $(DDEDOTVERSION:.=)
 
-REGDOTVERSION = 1.0
+REGDOTVERSION = 1.1
 REGVERSION = $(REGDOTVERSION:.=)
 
 BINROOT		= .
Index: win/makefile.bc
===================================================================
RCS file: /cvsroot/tcl/tcl/win/makefile.bc,v
retrieving revision 1.11
diff -u -r1.11 makefile.bc
--- win/makefile.bc	20 Aug 2002 15:33:34 -0000	1.11
+++ win/makefile.bc	18 Oct 2002 23:53:14 -0000
@@ -113,8 +113,8 @@
 DDEVERSION = 12
 DDEDOTVERSION = 1.2
 
-REGVERSION = 10
-REGDOTVERSION = 1.0
+REGVERSION = 11
+REGDOTVERSION = 1.1
 
 BINROOT		= ..
 !IF "$(NODEBUG)" == "1"
@@ -421,9 +421,9 @@
 	-@copy "$(TCLDDEDLL)" "$(SCRIPT_INSTALL_DIR)\dde1.1"
 	-@copy "$(ROOT)\library\dde\pkgIndex.tcl" "$(SCRIPT_INSTALL_DIR)\dde1.1"
 	@echo installing $(TCLREGDLLNAME)
-	-@$(MKDIR) "$(SCRIPT_INSTALL_DIR)\reg1.0"
-	-@copy "$(TCLREGDLL)" "$(SCRIPT_INSTALL_DIR)\reg1.0"
-	-@copy "$(ROOT)\library\reg\pkgIndex.tcl" "$(SCRIPT_INSTALL_DIR)\reg1.0"
+	-@$(MKDIR) "$(SCRIPT_INSTALL_DIR)\reg1.1"
+	-@copy "$(TCLREGDLL)" "$(SCRIPT_INSTALL_DIR)\reg1.1"
+	-@copy "$(ROOT)\library\reg\pkgIndex.tcl" "$(SCRIPT_INSTALL_DIR)\reg1.1"
 	@echo installing encoding files
 	-@$(MKDIR) "$(SCRIPT_INSTALL_DIR)\encoding"
 	-@copy "$(ROOT)\library\encoding\*.enc" "$(SCRIPT_INSTALL_DIR)\encoding"
Index: tests/registry.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/registry.test,v
retrieving revision 1.11
diff -u -r1.11 registry.test
--- tests/registry.test	31 Jul 2001 19:12:07 -0000	1.11
+++ tests/registry.test	18 Oct 2002 23:53:14 -0000
@@ -44,7 +44,7 @@
 } {1 {wrong # args: should be "registry option ?arg arg ...?"}}
 test registry-1.2 {argument parsing for registry command} {pcOnly} {
     list [catch {registry foo} msg] $msg
-} {1 {bad option "foo": must be delete, get, keys, set, type, or values}}
+} {1 {bad option "foo": must be broadcast, delete, get, keys, set, type, or values}}
 
 test registry-1.3 {argument parsing for registry command} {pcOnly} {
     list [catch {registry d} msg] $msg
@@ -582,21 +582,23 @@
     list [catch {registry set {\\mom\HKEY_CLASSES_ROOT\TclFoobar} bar foobar} msg] $msg
 } {1 {unable to open key: Access is denied.}}
 
+test registry-12.1 {BroadcastValue} {pcOnly} {
+    list [catch {registry broadcast} msg] $msg
+} {1 {wrong # args: should be "registry broadcast keyName ?-timeout millisecs?"}}
+test registry-12.2 {BroadcastValue} {pcOnly} {
+    list [catch {registry broadcast "" -time} msg] $msg
+} {1 {wrong # args: should be "registry broadcast keyName ?-timeout millisecs?"}}
+test registry-12.3 {BroadcastValue} {pcOnly} {
+    list [catch {registry broadcast "" - 500} msg] $msg
+} {1 {wrong # args: should be "registry broadcast keyName ?-timeout millisecs?"}}
+test registry-12.4 {BroadcastValue} {pcOnly} {
+    list [catch {registry broadcast {Environment}} msg] $msg
+} {0 {1 0}}
+test registry-12.5 {BroadcastValue} {pcOnly} {
+    list [catch {registry b {}} msg] $msg
+} {0 {1 0}}
 
 # cleanup
 unset hostname
 ::tcltest::cleanupTests
 return
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: doc/registry.n
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/registry.n,v
retrieving revision 1.6
diff -u -r1.6 registry.n
--- doc/registry.n	1 Jul 2002 18:24:39 -0000	1.6
+++ doc/registry.n	18 Oct 2002 23:53:14 -0000
@@ -50,6 +50,24 @@
 unique abbreviation for \fIoption\fR is acceptable.  The valid options
 are:
 .TP
+.VS 8.4
+\fBregistry broadcast \fIkeyName\fR ?\fI-timeout milliseconds\fR?
+.
+Sends a broadcast message to the system and running programs to notify them
+of certain updates.  This is necessary to propagate changes to key registry
+keys like Environment.  The timeout specifies the amount of time, in
+milliseconds, to wait for applications to respond to the broadcast message.
+It defaults to 3000.  The following example demonstrates how to add a path
+to the global Environment and notify applications of the change without
+reguiring a logoff/logon step (assumes admin privileges):
+.CS
+set regPath {HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment}
+set curPath [registry get $regPath "Path"]
+registry set $regPath "Path" "$curPath;$addPath"
+registry broadcast "Environment"
+.CE
+.VE 8.4
+.TP
 \fBregistry delete \fIkeyName\fR ?\fIvalueName\fR?
 .
 If the optional \fIvalueName\fR argument is present, the specified
Index: library/reg/pkgIndex.tcl
===================================================================
RCS file: /cvsroot/tcl/tcl/library/reg/pkgIndex.tcl,v
retrieving revision 1.10
diff -u -r1.10 pkgIndex.tcl
--- library/reg/pkgIndex.tcl	14 Sep 2001 01:00:59 -0000	1.10
+++ library/reg/pkgIndex.tcl	18 Oct 2002 23:53:14 -0000
@@ -1,8 +1,8 @@
 if {![package vsatisfies [package provide Tcl] 8]} {return}
 if {[info exists tcl_platform(debug)]} {
-    package ifneeded registry 1.0 \
-            [list load [file join $dir tclreg10d.dll] registry]
+    package ifneeded registry 1.1 \
+            [list load [file join $dir tclreg11d.dll] registry]
 } else {
-    package ifneeded registry 1.0 \
-            [list load [file join $dir tclreg10.dll] registry]
+    package ifneeded registry 1.1 \
+            [list load [file join $dir tclreg11.dll] registry]
 }
