VB Code:
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
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Private Sub Form_Load()
DownloadFile "http://www.allapi.net", "c:\allapi.htm"
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)...