I have got a small program to link by using the libmon header and import lib from the Windows SDK (version 7.0).

But it did involve a bit of hacking, mostly to #define away all the SAL annotations littering urlmon.h. I also had to provide an empty msxml.h file and #define a few pretend types to make the compiler happy (types I would not be using, so any old definition was ok).

After that, I think dynamic linking would be both easier and rather tidier!

(but without wrapping; that was done to make it display a bit better here.)

There were a couple of warnings about unknown #pragma's, but other than that it built ok, to url_test.exe. And ran! (It downloads a copy of the working draft of the C++ standard to the folder C:\Test, which is assumed to exist.)

And this version of main.cpp show what you need to do to receive status feedback (as it's a console app, I use the status info to update an ASCII progress bar...)

The URLDownloadToFile function appears to have been designed to work with ActiveX controls (i.e. COM objects), so that's the way the callback mechanism works. Might not be so easy to understand if you don't already know COM.