The URLDownloadToFile is actually an Internet Explorer API that most of the time doesn't seem to work anyway, and varies between versions. I would suggest using the winsock control / api, establishing a TCP connection on port 80, and sending a GET request, which would be a lot more reliable, and doesn't rely on IE. There's probably code out there that'll do that already, but its not complicated to do yourself.
