Shoutbox

File Sending Script - 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: File Sending Script (/showthread.php?tid=72821)

File Sending Script by Weekender on 03-19-2007 at 08:49 PM

Is there a script out there that can send a file without you having to close it? or it this impossible?


RE: File Sending Script by matty on 03-20-2007 at 06:17 AM

huh?!?

[Release] SendTo v2.2 [Final]


RE: File Sending Script by Felu on 03-20-2007 at 06:22 AM

I think he means that is it possible to send a file when the file is in use. I don't think this is possible.


RE: File Sending Script by matty on 03-20-2007 at 06:38 AM

This can easily be accomplished by doing this:

code:
function OnEvent_Initialize(MessengerStart){
    Debug.Trace('File In Use : '+_isFileInUse('\\\?\\c:\\doc1.doc'));
}

function _isFileInUse(_path){
    var _hfile = Interop.Call('kernel32',
                               'CreateFileW',
                               _path,
                               0x80000000     /* GENERIC_READ */,
                               0, 0,
                               3             /* OPEN_EXISTING */,
                               0x80             /* FILE_ATTRIBUTE_NORMAL */,
                               0);
    Interop.Call('kernel32', 'CloseHandle', _hfile);
    return _hfile = -1 ? true : false;
}

With this code you can create a script that will replace the normal /sendfile command and you can check if the file is in use, if it is copy it to another location and send it from there. I would say though to copy it to the scripts directory under like /files then on Uninitialize or SignOut you delete all the files.
RE: File Sending Script by Weekender on 03-20-2007 at 06:13 PM

ok thanks for the help, makes life easier =D