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!