Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Registry broadcast documentation

Closed / Invalid991898ffffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-07-15 20:51:36
In the example for the registry broadcast documentation 
it says 

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): 
set regPath 
{HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Cont
rol\Session Manager\Environment}
set curPath [registry get $regPath "Path"]
registry set $regPath "Path" "$curPath;$addPath"
registry broadcast "Environment"

This is not correct, the last line should be

registry broadcast $regPath
hobbsplain2004-07-16 03:58:06
Logged In: YES 
user_id=72656

I'm not sure that's 100% correct.  ActiveTcl correctly uses
just the last Environment element, and that has been tested
to work.  I remember something funny about that, but can't
recall it now.  It may be that both are correct.
kennykbplain2004-07-16 04:06:19
Logged In: YES 
user_id=99768

http://msdn.microsoft.com/library/en-us/sysinfo/base/wm_settingchange.asp
indicates that (I quote)

...when the string is a registry name, it typically
indicates only the leaf node in the registry, not the whole
path. 

Hence, it would appear that the example is correct.
dkfplain2004-08-04 16:24:38
Logged In: YES 
user_id=79902

Perhaps it would be more correct to say that MS habitually
gets it wrong, so they ended up documenting it that way, so
setting a mistake in stone as the way to do it...
Log in (anonymous is fine) to add a comment.