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

Progresbar
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Progresbar
Here are some progress bar functions:
code:
function Progress_GetPos(PlusWnd, CtrlId) {
    return PlusWnd.SendControlMessage(CtrlId, /*PBM_GETPOS*/ 0x408, 0, 0);
}

function Progress_SetPos(PlusWnd, CtrlId, nNewPos) {
    return PlusWnd.SendControlMessage(CtrlId, /*PBM_SETPOS*/ 0x402, nNewPos, 0);
}

function Progress_SetStep(PlusWnd, CtrlId, nStepInc) {
    return PlusWnd.SendControlMessage(CtrlId, /*PBM_SETSTEP*/ 0x404, nStepInc, 0);
}

function Progress_StepIt(PlusWnd, CtrlId) {
    return PlusWnd.SendControlMessage(CtrlId, /*PBM_STEPIT*/ 0x405, 0, 0);
}

//Usage example
var nPos = Progress_GetPos(oPlusWnd, "PrgDownload");
Progress_SetPos(oPlusWnd, "PrgDownload", nPos+10);

However, the actual position is hard to find. In fact, you should use a timer which gets the current file size of the downloaded file, divides that by the total file size to be downloaded and multiplies that by 100 to get the percentage. The catch is that you can't easily get the total file size, you'd need a text file on the server containing the file size to actually know how big the file to be downloaded is.

Actually, I don't really know if this is true, so if anyone can proof me wrong and provide me a way to get the file size of the server file, please tell me! :)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
09-15-2007 05:41 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Progresbar - by Drakal on 09-15-2007 at 05:10 PM
RE: Progresbar - by Matti on 09-15-2007 at 05:41 PM
RE: Progresbar - by Drakal on 09-15-2007 at 06:00 PM
RE: Progresbar - by Flash on 09-15-2007 at 11:28 PM
RE: Progresbar - by Matti on 09-16-2007 at 06:37 AM
RE: Progresbar - by Drakal on 09-16-2007 at 08:39 AM
RE: Progresbar - by Matti on 09-16-2007 at 10:01 AM
RE: Progresbar - by Drakal on 09-16-2007 at 12:02 PM
RE: Progresbar - by Matti on 09-16-2007 at 05:25 PM
RE: Progresbar - by Drakal on 09-17-2007 at 01:43 PM
RE: Progresbar - by Matti on 09-17-2007 at 05:05 PM
RE: Progresbar - by Drakal on 09-17-2007 at 08:31 PM
RE: Progresbar - by Matti on 09-18-2007 at 04:54 PM
RE: Progresbar - by Drakal on 09-18-2007 at 07:28 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