Ver Mensaje Individual
  #3  
Antiguo 16-12-2008
Belaix Belaix is offline
Miembro
 
Registrado: nov 2008
Posts: 14
Reputación: 0
Belaix Va por buen camino
Smile

Joe, acabo de encontrar este código:

Código Delphi [-]
function FileInUse(FileName: string): Boolean;
var hFileRes: HFILE;
begin
  Result := False;
  if not FileExists(FileName) then exit;
  hFileRes := CreateFile(PChar(FileName),
                                    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;

Pero el tuyo me gusta muchiiiisimo más.

Mil gracias duilioisola!
Responder Con Cita