Hi,
I have the following very simple program to download an image from the internet, and store it on my HD:
However, I want this program to run, download the image, and then close immediately without displaying the 'Press any key to continue...' message. Is there a way to make a program close without the user pressing a key? It sounds simple I know, but I have been googling, and can't find anything!Code:#include <iostream> #include <urlmon.h> #pragma comment(lib, "urlmon.lib") using namespace std; int main (){ cout << "Downloading latest image..." << endl; HRESULT hr = URLDownloadToFile( NULL, L"http://sohowww.nascom.nasa.gov/data/realtime/hmi_igr/1024/latest.jpg", L"c://Documents and Settings//XP//My Documents//latestsun.bmp", 0, NULL ); return 0; }
Thanks.



LinkBack URL
About LinkBacks



