Hi everyone,
I have some code which downloads an image from the internet when a button IDC_DOWNLOAD is pressed in a Win32 program:
Code:
case IDC_DOWNLOAD:
DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_LOADING), hwnd, ToolDlgProc);
URLDownloadToFile( NULL, "http://website.com/image.jpg", "image.bmp", 0, NULL );
ShellExecute(NULL, "open", "image.bmp", NULL, NULL, SW_SHOWNORMAL);
break;
It works fine and downloads and displays the image when I get rid of the DialogBox line, but for some reason when I put the DialogBox part in, it just opens the dialog box and doesn't download the image. Is there a way to load a dialog box and also continue to download and display the image?
Thanks.