home *** CD-ROM | disk | FTP | other *** search
/ Programming Win32 Under the API / ProgrammingWin32UnderTheApiPatVillani.iso / Chapter5 / 5-1 / CreateFile.c
C/C++ Source or Header  |  2000-07-13  |  448b  |  22 lines

  1.  
  2. #include <windows.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.     HANDLE hFile;
  7.  
  8.     hFile = CreateFile("\\MyFile.txt",    // name of the file  
  9.             GENERIC_WRITE,        // open for writing 
  10.             0,            // do not share 
  11.             NULL,            // no security 
  12.             CREATE_ALWAYS,        // overwrite existing 
  13.             FILE_ATTRIBUTE_NORMAL |    // normal file 
  14.             FILE_FLAG_OVERLAPPED,    // asynchronous I/O 
  15.             NULL);            // no attr. template 
  16.  
  17.     CloseHandle(hFile);
  18.     return 0;
  19. }
  20.  
  21.  
  22.