Solved

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

Posted on 2004-10-22
2,235 Views
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.
0
Question by:iflash
    5 Comments
     
    LVL 26

    Assisted Solution

    by:EDDYKT
    0
     
    LVL 9

    Accepted Solution

    by:
    0
     
    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.
    0
     

    Author Comment

    by:iflash
    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.
    0
     
    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.
    0

    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