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

Posted on 2004-10-22
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, "", 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
    LVL 26

    Assisted Solution

    LVL 9

    Accepted Solution

    LVL 9

    Expert Comment

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

    Author Comment

    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.
    LVL 9

    Expert Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Product Review - Android Remix

    Come along for the ride with our Senior Product Manager, Brian Matis, as he reviews the Android Remix.

    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    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.
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    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…

    933 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now