I have a console app that when started check for internet connection availability and than download someting from the web and close it self. But I need to implement two new features to it and don't know how. It should stay in memory even if conn is not available and check for it periodicaly and than download the file. And the socond one is to implement download resume function. I would send my 3 KB app to anyone who is able to append these features to it and send it back to me. with a bit of comment. Thank you very much. i am absolute beginner in MASM. Thank you. Radim
Posted on 2001-02-04 15:36:00 by raguru
To check periodically, create a timer with a hidden window that sends a WM_TIMER message each minute or so. To stay in memory, just don't quit :-), just hide your window(s). For a download resume you'd better take a look at the HTTP standard (search for HTTP at rfc-editor), you will have to send a byte-range in your headers to the server to indicate which part of the file you want to retreive. Now I think of it, there's a HTTP download example at Iczelions site with resume support. Thomas edit by Hiro: corrected the links to the new model This message was edited by Hiroshimator, on 2/5/2001 1:40:17 PM
Posted on 2001-02-04 16:05:00 by Thomas
Yes I now that Iczelion's example, but I am beginner and It is too complicated for me. I even don't know how to crate a timer you suggested. I need more help. Then You. Radim
Posted on 2001-02-05 13:25:00 by raguru
to receive a WM_TIMER just call SetTimer(...) with the appopriate parameter, and KillTimer() when you don't need it.
Posted on 2001-02-05 17:01:00 by blackhorus
A window is not necessary. SetTimer allows you to define a TimerProc which bypasses the need for WM_TIMER at all. You can set the HWND and EventID value to NULL, then use a predefined TimerProc function to catch it. The only thing is you must still use the message translation and dispatching code in your program. This will save you unnecessary windows, displayed or not.
Posted on 2001-02-05 22:07:00 by Racso