I'm sure that this is a dumb question but
URLDownloadToFile seems to take over my app when active and I want my user to be able to enter stuff in Textboxes etc while the download is occuring. How do I do this?
Printable View
I'm sure that this is a dumb question but
URLDownloadToFile seems to take over my app when active and I want my user to be able to enter stuff in Textboxes etc while the download is occuring. How do I do this?
I think you would use the DoEvents keyword. I am not too sure on that.
DoEvents won't work unless you're in a loop, the first thing that comes to mind is make another application that has only a SubMain routine, and pass in the download arguements as commandline parameters. I've never done anything like that before but its what my little brain thought of first, anyone else have an easier solution?
I think DoEvents would allow other things to happen at the time of calling but could not be triggered in the middle of a ten minute download - is that right?Quote:
Originally posted by jjortiz
I think you would use the DoEvents keyword. I am not too sure on that.
Code:Public Function DownloadFile(URL As String, _
LocalFilename As String) As Boolean
Rem call the DownloadFile function, passing it your URL and local filename. The function will then use the API to download the file and return a True if successful.
Dim lngRetVal As Long
'Screen.MousePointer = 11
GlobalFlag_Downloaded = False
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
Screen.MousePointer = 0
If lngRetVal = 0 Then DownloadFile = True
GlobalFlag_Downloaded = True
End Function
OK if you ever find that you want to do this yourself the MSDN URL is this with the IBindStatusCallback interface.