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; 

摘自 橙子

相关文章:

  • 2022-01-31
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2021-10-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2021-08-23
  • 2022-12-23
相关资源
相似解决方案