In your HTA or HTML do this to start the progress bar:
This will assign the progress bar to a variable and keep the window on top at all times. when the progress bar reaches 100% it will close itself
How to update the progress bar:
First you should determine the total length of the items you are going through, wether it be the length of an array, or total number of objects. Inside your loop update the progress bar like this:
progress.progress(current index,Total Elements - 1); //0 based array