What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Help] Download progress?

Pages: (2): « First [ 1 ] 2 » Last »
[Help] Download progress?
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. [Help] Download progress?
Hi,

I am wondering if there is a way to monitor a file's download progress.
Since MsgPlus.DownloadFile() can't do this, I am looking for other ways to download a file, perhaps even with an XMLHTTP request (but there's probably some function in the Windows API, that's unknown to me :S ).

So, is there any way to monitor download progresses as IE and FireFox do?

Thanks in advance.
07-01-2008 02:12 PM
Profile PM Find Quote Report
Basilis
Veteran Member
*****

Avatar
Olympiacos CFP

Posts: 1366
Reputation: 46
31 / Male / Flag
Joined: Dec 2007
RE: [Help] Download progress?
There is a control that displays a bar in the window which is like downloading but not like displaying a progress.

Here it is:

<Control xsi:type="ProgressControl" Id="Example">
        <Position Top="5" Width="100" Left="0" Height="10"/>
                <Marquee/>
</Control>

This post was edited on 07-01-2008 at 02:21 PM by Basilis.
[Image: logo1nu1.png]
07-01-2008 02:15 PM
Profile PM Find Quote Report
mynetx
Skinning Contest Winner
*****

Avatar
Microsoft insider

Posts: 1175
Reputation: 33
37 / Male / Flag
Joined: Jul 2007
RE: [Help] Download progress?
Call the MsgPlus.DownloadFile with a OutFile parameter that you know, and then check the filesize of the OutFile, based on a timer (FSO object, GetFile method, Size property).
mynetx - Microsoft, enhanced.

You have a problem or issue with Windows, Internet
Explorer or Office?
Send a tweet!
07-01-2008 02:18 PM
Profile E-Mail PM Web Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: [Help] Download progress?
Okay, that's an option for a known file.. But it won;t be possible for unknown OutFile's..

EDIT::

Here's what I'd like to do:

[Image: screenieyd3.th.jpg]

quote:
Originally posted by Basilis
There is a control that displays a bar in the window which is like downloading but not like displaying a progress.

Here it is:

<Control xsi:type="ProgressControl" Id="Example">
        <Position Top="5" Width="100" Left="0" Height="10"/>
                <Marquee/>
</Control>


Yes, that's that nice progress bar in IE which makes my PC freeze up :P

However, Microsoft has been so nice not to write an easy function to detect progresses :S .

This post was edited on 07-01-2008 at 02:21 PM by SmokingCookie.
07-01-2008 02:19 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Help] Download progress?
quote:
Originally posted by SmokingCookie
However, Microsoft has been so nice not to write an easy function to detect progresses :S .

just some quick thoughts without checking things first:

I very much doubt that there is an API like that which shows how much percent/ratio is completed. What maybe might exist is a callback function which reports back how many bytes have been saved so far or something.

But:
- You can't use such callbacks in Messenger Plus! anyways since they will be more than likely asynchronous callbacks.
- You still need to know the size of the complete file in order to be able to show a progress bar (which is always in the form of a ratio: x out of y, or x green/blue bars out of a total of y bars).

What you could do instead is showing a 'busy' indicator to the user. In that way the user still wont be able to see how much longer it will take, but he would be able to see that the script is still busy downloading. As a bonus you could also show the amount of bytes already downloaded, which is another good indication that the script is still busy doing usefull stuff instead of being in a dead-loop or been froozen.

This post was edited on 07-01-2008 at 09:39 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-01-2008 09:33 PM
Profile PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: [Help] Download progress?
Okay, then I'll do that.

However, one CAN make a progress bar indicating the readyState of an XMLHTTP request. Example:

Debug.Trace("> " + (25 * XMLHTTP.readyState));

This will go no further than 100%, so it's possible to indicate what the script is doing (sending request, receiving headers etc.)
07-02-2008 07:42 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Help] Download progress?
quote:
Originally posted by SmokingCookie
Okay, then I'll do that.

However, one CAN make a progress bar indicating the readyState of an XMLHTTP request. Example:

Debug.Trace("> " + (25 * XMLHTTP.readyState));

This will go no further than 100%, so it's possible to indicate what the script is doing (sending request, receiving headers etc.)
yep, but that is of course not really a progress bar either. The user usually wants to see the progress of the actual downloading (readyState 3), not the usually very fast initializing....

But it is way better than nothing of course....

(Do I smell a suggestion for the MsgPlus.DownloadFile() function here? :P)

This post was edited on 07-02-2008 at 06:08 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-02-2008 06:08 PM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [Help] Download progress?
quote:
Originally posted by CookieRevised
(Do I smell a suggestion for the MsgPlus.DownloadFile() function here? :P)
Something like a OnEvent_DownloadFileProgress(Url, OutFile, BytesDownloaded, BytesTotal) would be nice, yes. Go and bug Patchou about it! :P
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
07-02-2008 06:16 PM
Profile E-Mail PM Web Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: [Help] Download progress?
That certainly is a good idea :P .. But at high download speeds, this event would be triggerd.. Many times :P (like an infinite loop). And I'm not even talking about big files being dowloaded at high speed..
07-02-2008 07:26 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Help] Download progress?
Timers can be triggered extremely quickly to though....

Then again, it could be solved a bit by adding a packet size parameter to DownloadFile() (or new downloadfile function) to tell Plus! to trigger DownloadFileProgress() each x bytes.

-------

Anyways, can't you just make something with some kind of ActiveX object or whatever. I mean, when you download a file with your browser, it usually tells you also how big the file is and thus being able to show you a progress dialog. So, find out how they do that (probably sending some kind of request first) and do the same in your script.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-02-2008 07:39 PM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


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