I create a folder in my OnInitDialog:
Then in an onButonClick event I create a handle to that directory:
hFile = CreateFile("c:\\FolderToCompress",GENERIC_READ,NULL,NULL,NULL,NULL,NULL);
I then move a file to the directory:
Then set the compression attribute with deviceIoControl:
DeviceIoControl(hFile, FSCTL_SET_COMPRESSION, &Format, sizeof(USHORT),
NULL, 0, &dummy, NULL);
All this works correctly, the folder is created and file moved into it but the folder is not compressed when finished. There is something that I am obviously missing here and any light on the matter would be greatly appreciated.