Update free space amount displayed in Windows Explorer

廉价感情. 提交于 2019-12-08 11:21:32

If you are using Delphi 7, then SHCNF_PATH will map to the ANSI version, SHCNF_PATHA. In which case passing PWideChar is wrong. 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, then you need to use SHCNF_PATHW.

var
  Drive: WideString;
....
Drive := 'C:\';
SHChangeNotify(SHCNE_FREESPACE, SHCNF_PATHW, PWideChar(Drive), nil);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!