Ver Mensaje Individual
  #17  
Antiguo 21-08-2018
Avatar de gatosoft
[gatosoft] gatosoft is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Bogotá, Colombia
Posts: 833
Reputación: 21
gatosoft Va camino a la fama
Solo para el registro... si quisiera comprobar si un archivo se encuentra en uso, podrías probar con el código:

Código Delphi [-]
function FileIsInUse(aName : string) : boolean;
var
    HFileRes : HFILE;
begin
  if FileExists(aName) then
  begin
    HFileRes := CreateFile(pchar(aName), GENERIC_READ or
      GENERIC_WRITE,0, nil,
      OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, 0);
    Result := (HFileRes = INVALID_HANDLE_VALUE);
    _lclose(HFileRes);
  end
  else
    Result := false;
end;
Responder Con Cita