Progress Bar for URLDownloadtoFile Lib "urlmon" Alias "URLDownloadToFileA"

Posted on 2004-10-22
Medium Priority
Last Modified: 2007-12-19
Hi all,

Im having trouble creating a download progress bar for the URLDownloadToFile function which uses the urlmon library.

For example.. in the following code, i wish to display a simple progress bar when I'm downloading a file using the URLDownloadToFile function:

Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

Private Sub Command1_Click()

Call URLDownloadToFile(0, "http://mysite.com/myfile.exe", App.Path & "myfile.exe", 0, 0)

' Show progress meter here... but I dont know how.. please HELP!

End Sub

Can anyone please help? it will be great if the progressbar is showed on the separate form, and then when download completes, the form would close/hide.

Thank you so much.
Question by:iflash
  • 3
LVL 26

Assisted Solution

EDDYKT earned 200 total points
ID: 12379660

Accepted Solution

Shahid Thaika earned 800 total points
ID: 12379670

Expert Comment

by:Shahid Thaika
ID: 12591012
I am with the decision :). We both did our bit to help out. But the author did not reply.

Author Comment

ID: 12591019
Well there is still no obvious solution, but eeshahidt is the closest.. so i'll reward you with more points...

thanks for helping out guys.

Expert Comment

by:Shahid Thaika
ID: 12591845
Thank You. But I still don't mind answering any question you may have. But please be more specific.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As a person who answers a lot of questions, I often see code that could be simplified, made easier to read, and perhaps most importantly made easier to maintain if the code was modified to use the Select Case statement. This article explains how to…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question