Now that Microsoft have reinstated OneDrive in the file system in Windows 10 (and assuming they don't drop it again in 6 months time), I'm looking for how to determine the sync status of an arbitrary file.
There are at least five different states shown in Explorer (this is just what I've observed, there may be others):
Available when online
Available on this device
Always available on this device
Syncing / downloading
Error
The first two states, for a file, can be determined using the FILE_ATTRIBUTE_OFFLINE attribute.
It seems that the "Always available" state can be determined for a file using a new, undocumented file attribute 0x00080000.
Determining these states for folders, and the syncing and error states for both files and folders, however remains a mystery.
My first thought was using the property system (IPropertyStore), but the following four property keys all failed to help:
PKEY_OfflineAvailabilityreturnsVT_EMPTYPKEY_OfflineStatusreturnsVT_EMPTYPKEY_FilePlaceholderStatusreturns an undocumented value (0xe) but it doesn't change when the status doesPKEY_FileOfflineAvailabilityStatusreturnsVT_EMPTY
I have a feeling this is going to turn out to be just another undocumented Microsoft API but I thought I'd ask to see if anyone has any suggestions.
{e77e90df-6271-4f5b-834f-2dd1f245dda4} 3) that seems to contain some (undocumented also) enum value.There is a mention of this property in ShObjIdl.idl but what I see doesn't seem to correspond to the values of SYNC_ENGINE_STATE_FLAGS. Note the latest SDK has also a new cfapi.h ("cloud file" API) that could be interesting too...cfapi.hso I suspect this is the right track to take. Thanks!