VB Code:
  1. Private 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
  2. Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
  3.     Dim lngRetVal As Long
  4.     lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
  5.     If lngRetVal = 0 Then DownloadFile = True
  6. End Function
  7. Private Sub Form_Load()
  8.     'example by Matthew Gates ([email protected])
  9.     DownloadFile "http://www.allapi.net", "c:\allapi.htm"
  10. End Sub

My program downloads image after image... Some of the images are +1MBs... So they take +5 seconds to download, and when ever its downloading my whole application stops (cannot move the window, windows is not updated (if a other window goes over it, the window will only be updated once the image is done downloaded))....

So how would I change that code so my program works normally even when the image is downloading?

note: Its kind of like when you have a loop that takes forever, while vb is in the loop, you cannot do anything with the program (but in a loop you can use DoEvents)...