How to tell if a Windows folder has content-indexing enabled?

482 Views Asked by At

I am looking for a Windows API that I can call from Delphi 2010 which will allow my application to determine if a specific folder has content-indexing enabled. In other words whether there is a tick in the checkbox named 'Allow files in this folder to have contents indexed in addition to file properties' which is in the Advanced Attributes page of the Property dialog when you right-click the folder. I cannot find much about this on MSDN, but maybe I am not looking in the right places.

1

There are 1 best solutions below

3
On BEST ANSWER
function IsFolderIndexed(const folderName: string): boolean;
begin
  Result := (GetFileAttributes(folderName) AND $2000) = 0;
end;

Ref: http://msdn.microsoft.com/en-us/library/ee332330(VS.85).aspx