Shoutbox

Read another HKEY - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Read another HKEY (/showthread.php?tid=95952)

Read another HKEY by PedroGabriel on 12-03-2010 at 08:35 AM

Hi,
I want know how to read another HKEY...
Eg:

Javascript code:
var
  Reg1 = 0;
  Reg1Path = "HKEY_CURRENT_USER\SessionInformation"+"\\ProgramCount";
  Shell = new ActiveXObject('WScript.Shell');
 
 
function Read(){
    Reg1 = Shell.RegRead(Reg1Path);
return Reg1;
}
 
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, rMessage, MsgKind){
    if (rMessage == 'aaa'){
        Read();
        Messenger.MyPersonalMessage = Reg1;
        ChatWnd.SendMessage(Reg1);
    }
}


I only find HKEY_CURRENT_USER\SessionInformation\ProgramCount
on the WinXP, this reg show how many apps are running

How to read that?

Thanks  for attention =]
RE: Read another HKEY by matty on 12-03-2010 at 12:06 PM

If I am not mistaken you need to use HKCU instead of HKEY_CURRENT_USER. Also you need to escape your backslashes (\\).

http://msdn.microsoft.com/en-us/library/x05fawxd(VS.85).aspx


RE: Read another HKEY by PedroGabriel on 12-03-2010 at 05:40 PM

Oh thanks for your help =]
that works

Javascript code:
Reg1 = Shell.RegRead ("HKCU\\SessionInformation\\ProgramCount");


Ty.