Shoutbox

path of historique storage directorie of MP!live - 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: path of historique storage directorie of MP!live (/showthread.php?tid=76757)

path of historique storage directorie of MP!live by mondator on 08-13-2007 at 07:12 PM

how i can know the directory where mp!live stocke log of discution


RE: path of historique storage directorie of MP!live by matty on 08-13-2007 at 07:20 PM

Read this registry key

HKEY_CURRENT_USER\Software\Patchou\Messenger Plus! Live\%Email%\Preferences\LogsDirectory it is a REG_SZ

Where %Email% is the email of the person.


RE: path of historique storage directorie of MP!live by Matti on 08-13-2007 at 07:22 PM

This is the way I'd do it:

code:
var RegScriptPath = MsgPlus.ScriptRegPath; //Get the script registry path
var RegPrefsPath = RegScriptPath.substr(0, RegScriptPath.indexOf("GlobalSettings")) + Messenger.MyEmail + "\\Preferences"; //Get the Plus! preferences path
var sPath = new ActiveXObject("WScript.Shell").RegRead(RegPrefsPath + "\\LogsDirectory"); //Get Plus!' default log directory

EDIT:
@ matty: Note that it's possible that that path changes in a future Plus! version. Therefore, I more like to get the path based on the script's registry path. ;)
And yes, I know that it's more recommended to use Win32 API functions to read the key but I leave that for you to choose whether you want to implement such functions.
RE: path of historique storage directorie of MP!live by matty on 08-13-2007 at 08:05 PM

I was just stating where the key is that he/she needs to read as you see no code I posted. What would be even better would be to read the EnableChatLog DWORD value and read based on if that is 1 or 0.


RE: path of historique storage directorie of MP!live by mondator on 08-13-2007 at 08:26 PM

thanks mattike thats perfect but how can have the list of name of files ho exist in the directory?


RE: path of historique storage directorie of MP!live by matty on 08-13-2007 at 08:38 PM

Use the Win32 API FindFirstFile and FindNextFile.


RE: path of historique storage directorie of MP!live by mondator on 08-14-2007 at 12:21 AM

thanks matty but u always and i dont know wy u give only the headline i need a one hour with your instruction to find exactly the right code can u be more nice and next time be more explination and give some piece of code?


RE: path of historique storage directorie of MP!live by matty on 08-14-2007 at 12:54 AM

The reason why I don't just post code now a days is because everyone justs asks without doing any research. There is a reason there is MSDN from Microsoft. It is to tell you how to use the APIs. No offence but you have only asked for code from what I have seen without actually doing any yourself.

Why don't you try to do something yourself without constantly asking for us to just provide you with the code? It isn't that hard at all!

code:
/*
    Name:     GetDirectoryStructure
    Purpose:    Create a list of all the files from a given location on the disc
    Parameters:    sPath - Path to get all the files from
            includePath - If true, will include the full path to the filename, if false will only display the filename
    Return:    An array of the files from the path
*/

function GetDirectoryStructure(sPath, includePath) {
    var aFileNames = new Array();
    var Win32_Find_Data = Interop.Allocate(592);
    var hSearch = Interop.Call('kernel32', 'FindFirstFileW', sPath + '*', Win32_Find_Data);
    var hResult;
    while(hResult != 0){
        if((Win32_Find_Data.ReadString(44) !== '.') && (Win32_Find_Data.ReadString(44) !== '..') && !(Win32_Find_Data.ReadDWORD(0) & 0x10)){
            aFileNames.push ((includePath ? sPath : '')+Win32_Find_Data.ReadString(44));
        }
        hResult = Interop.Call('kernel32', 'FindNextFileW', hSearch, Win32_Find_Data)
    }
    Interop.Call('kernel32', 'FindClose', hSearch);
    return aFileNames;
}

RE: path of historique storage directorie of MP!live by mondator on 08-14-2007 at 10:14 AM

thanks matty for advice i do this but some time i spent a lot of time for a very small thing ho can people give it in 3s so that save alot of time and give u chanse to do more importante things :D


RE: path of historique storage directorie of MP!live by matty on 08-14-2007 at 03:44 PM

But the point is you don't learn by someone just giving you code.