What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Registry Class

Registry Class
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Registry Class
I got a PM asking how to use the Registry Enum components well this is how it is done.

code:
function OnEvent_Initialize(MessengerStart) {
    var objSubKeys = {}
    Registry_EnumSubkeys(HKCU, 'Software\\Patchou\\Messenger Plus! Live', objSubKeys);
   
    for (var objSubKey in objSubKeys) {
        Debug.Trace(objSubKey);
        var objValues  = {};
        Registry_EnumKeys(HKCU, 'Software\\Patchou\\Messenger Plus! Live\\'+objSubKey+'\\Preferences', objValues);
        for (var objValue in objValues) {
            Debug.Trace('  > '+objValue+' : '+objValues[objValue]);
        }
    }
}

Another function you can do in the script is to print out a registry tree.

code:
function OnEvent_Initialize(MessengerStart) {
    Debug.Trace('Software\\Patchou\\Messenger Plus! Live');
    GetRegistryTree(HKCU, 'Software\\Patchou\\Messenger Plus! Live', '  ');
}

function GetRegistryTree(Location, Key, prefix) {
    var objSubKeys = {};
    var objValues  = {};

    Registry_EnumKeys(Location, Key, objValues);
    for (var objValue in objValues) {
        Debug.Trace(prefix+'> '+objValue+'\t: '+objValues[objValue]);
    }
    Registry_EnumSubkeys(Location, Key, objSubKeys);
    for (var objSubKey in objSubKeys) {
        Debug.Trace(prefix+Key+'\\'+objSubKey);
        GetRegistryTree(Location, Key+'\\'+objSubKey, prefix+'  ');
    }
}

And a Delete Tree function

code:
function OnEvent_Initialize(MessengerStart) {
    Registry_DeleteTree(HKEY_LOCAL_MACHinE, 'Software\\Patchou');
        Debug.Trace('Registry_DeleteKey[\'Software\\Patchou]\' : '+Registry_DeleteKey(HKEY_LOCAL_MACHINE, 'Software\\Patchou'));
}

function Registry_DeleteTree(Location, Key) {
    var objSubKeys = {};
    var objValues  = {};

    Registry_EnumKeys(Location, Key, objValues);
    for (var objValue in objValues) {
        Debug.Trace('Registry_DeleteKeyValue['+Key+'\\'+objValue+'] : '+Registry_DeleteKeyValue(Location, Key, objValue));
    }
    Registry_EnumSubkeys(Location, Key, objSubKeys);
    for (var objSubKey in objSubKeys) {
        Registry_DeleteTree(Location, Key+'\\'+objSubKey);
        Debug.Trace('Registry_DeleteKey['+Key+'\\'+objSubKey+'] : '+Registry_DeleteKey(Location, Key+'\\'+objSubKey));
    }
}

This post was edited on 08-04-2007 at 04:37 AM by matty.
08-04-2007 12:42 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Registry Class - by LifelesS on 08-03-2007 at 07:01 PM
RE: Registry Class - by Ezra on 08-03-2007 at 07:17 PM
RE: Registry Class - by LifelesS on 08-03-2007 at 07:19 PM
RE: Registry Class - by Ezra on 08-03-2007 at 07:21 PM
RE: Registry Class - by LifelesS on 08-03-2007 at 07:23 PM
RE: Registry Class - by Ezra on 08-03-2007 at 07:28 PM
RE: RE: Registry Class - by LifelesS on 08-03-2007 at 07:34 PM
RE: Registry Class - by matty on 08-03-2007 at 08:16 PM
RE: RE: Registry Class - by LifelesS on 08-03-2007 at 08:19 PM
RE: Registry Class - by matty on 08-03-2007 at 08:23 PM
RE: Registry Class - by LifelesS on 08-03-2007 at 08:53 PM
RE: Registry Class - by Ezra on 08-03-2007 at 10:41 PM
RE: RE: Registry Class - by LifelesS on 08-03-2007 at 10:47 PM
RE: Registry Class - by matty on 08-04-2007 at 12:19 AM
RE: RE: Registry Class - by LifelesS on 08-04-2007 at 12:36 AM
RE: Registry Class - by matty on 08-04-2007 at 12:42 AM
RE: Registry Class - by Matti on 08-04-2007 at 11:27 AM
RE: Registry Class - by matty on 08-04-2007 at 12:02 PM
RE: Registry Class - by -dt- on 08-04-2007 at 12:16 PM
RE: Registry Class - by ShawnZ on 08-04-2007 at 12:18 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On