If you are using Delphi 7, then the version of ANSI, SHCNF_PATHA will be displayed on SHCNF_PATHA . In this case, the PWideChar transfer is incorrect. Write it like this:
var Drive: string; .... Drive := 'C:\'; SHChangeNotify(SHCNE_FREESPACE, SHCNF_PATH, PChar(Drive), nil);
Or, if you prefer to use the Unicode version, you need to use SHCNF_PATHW .
var Drive: WideString; .... Drive := 'C:\'; SHChangeNotify(SHCNE_FREESPACE, SHCNF_PATHW, PWideChar(Drive), nil);
source share