home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Win32 Under the API
/
ProgrammingWin32UnderTheApiPatVillani.iso
/
Chapter5
/
5-1
/
CreateFile.c
Wrap
C/C++ Source or Header
|
2000-07-13
|
448b
|
22 lines
#include <windows.h>
int main(int argc, char *argv[])
{
HANDLE hFile;
hFile = CreateFile("\\MyFile.txt", // name of the file
GENERIC_WRITE, // open for writing
0, // do not share
NULL, // no security
CREATE_ALWAYS, // overwrite existing
FILE_ATTRIBUTE_NORMAL | // normal file
FILE_FLAG_OVERLAPPED, // asynchronous I/O
NULL); // no attr. template
CloseHandle(hFile);
return 0;
}