August 14, 2016

Open/create directory

To open an existing directory, use CreateFile() with the FILE_FLAG_BACKUP_SEMANTICS attribute:

To create directory:

  1. If you don't need to create intermediate directories, use CreateDirectory():

  2. Otherwise, use SHCreateDirectoryEx().

    In Visual C++ 6.0, you'll have to use LoadLibrary() and GetProcAddress() with shell32.dll; as a procedure name, specify either SHCreateDirectoryExW() or SHCreateDirectoryExA(), not just SHCreateDirectoryEx().

No comments:

Post a Comment