As far as I know, the way to create a hidden folder is:
CreateDirectory( folderName ); SetFileAttributes( folderName, FILE_ATTRIBUTE_HIDDEN );
Doing this causes the directory to exist, for a moment, as not hidden. Other programs like cloud software and backup can mistakenly see it as non-hidden... and do something with it.
Is it possible to achieve the same thing in a single API call? One atomic step? Seems like it should be possible! ??
You can use CreateDirectoryEx
for this.
Creates a new directory with the attributes of a specified template directory. If the underlying file system supports security on files and directories, the function applies a specified security descriptor to the new directory. The new directory retains the other attributes of the specified template directory.
You need a template directory handy with suitable (i.e. hidden) attributes.