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

How to download
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: How to download
The mimetype is image/jpg.

You can use the Win32 API URLDownloadToFile.

Your code would look something like this:
code:
function URLDownloadToFile (sUrl, sFile) {
    Interop.Call('wininet.dll', 'DeleteUrlCacheEntryW', sUrl);
    Interop.Call('urlmon.dll', 'URLDownloadToFileW', 0, sUrl, sFile, 0, Interop.GetInterfacePtr('OnProgress'));
}

function OnProgress (ulProgress, ulProgressMax, ulStatusCode, szStatusText) {
    if (ulProgress == ulProgressMax) Debug.Trace('Download Complete');
}

Now I cannot guarantee that the callback function for this works because Plus! had to handwrite all of the function callbacks and he may have missed this one. If this is the case then you can do this:

code:
function URLDownloadToFile (sUrl, sFile) {
    Interop.Call('wininet.dll', 'DeleteUrlCacheEntryW', sUrl);
    Interop.Call('urlmon.dll', 'URLDownloadToFileW', 0, sUrl, sFile, 0, 0);
}

This post was edited on 11-24-2008 at 01:59 PM by matty.
11-24-2008 01:55 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
How to download - by ArkaneArkade on 11-20-2008 at 11:05 PM
RE: How to download - by SmokingCookie on 11-24-2008 at 07:31 AM
RE: How to download - by ArkaneArkade on 11-24-2008 at 08:42 AM
RE: How to download - by matty on 11-24-2008 at 01:55 PM
RE: How to download - by ArkaneArkade on 11-25-2008 at 05:25 AM
RE: How to download - by Spunky on 11-25-2008 at 11:58 AM
RE: How to download - by matty on 11-25-2008 at 12:35 PM
RE: How to download - by Matti on 11-25-2008 at 05:46 PM
RE: How to download - by matty on 11-25-2008 at 06:05 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