function IsFileInUse(AName: string): boolean;
var
hFileRes: HFILE;
begin
Result := False;
if not FileExists(AName) then exit;
hFileRes := CreateFile(PChar(AName), GENERIC_READ or GENERIC_WRITE, 0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
Result := hFileRes = INVALID_HANDLE_VALUE;
if not Result then
CloseHandle(hFileRes);
end;
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。