Search
 
SCRIPT & CODE EXAMPLE
 

C

c/c++ windows api download file

#include <windows.h>

// + compiler option -lurlmon

int main() {
  /*
  HRESULT URLDownloadToFile(
             LPUNKNOWN            pCaller,
             LPCTSTR              szURL,
             LPCTSTR              szFileName,
  _Reserved_ DWORD                dwReserved,
             LPBINDSTATUSCALLBACK lpfnCB
);
  */
  
  if (URLDownloadToFileA(NULL, (LPCSTR) "http://your/file/path.ending", (LPSTR) "filename.ending", 0,
                       NULL) == S_OK) {
    // download success
    return 0;
  }
  
  return -1;
}

Comment

PREVIOUS NEXT
Code Example
C :: inputting an array in c 
C :: c programming language 
C :: Example of Implementation of a pointer to an array in C: 
C :: houdini vex loop over points 
C :: c round float 
C :: how to add 1 to 10 in c 
C :: selection sort algorithm in c 
C :: c find last element in array 
C :: syntax 
C :: clear screen in c 
C :: c remove last charachter from string 
C :: multiplication of matrix in c 
C :: c include delay 
C :: hourglass sum 
C :: how to transform a char to ascii code in c 
C :: do while loop in c 
C :: wifi access point in esp8266 
C :: c pause for 1 second 
C :: compile multiple c files 
C :: oracle trunc 
C :: stack pop 
C :: convert python to c 
C :: gcc compiler for windows 10 
C :: convert c to phyton 
C :: Tensorflow: What are the "output_node_names" for freeze_graph.py in the model_with_buckets model? 
C :: c program to pass a single element in an funtional array 
C :: how to write flash memory in stm32f030 
C :: Handling exceptions during datetime conversion 
C :: diiferent between * and & in c 
C :: bullseye lxc network problem 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =