procedure TOpenDialog.CanClose(var CanClose: Boolean); var I: Integer; {$IFDEF MSWINDOWS} Drive: string; DT: Cardinal; {$ENDIF} begin if Form <> nil then (Form as IFileDialogForm).ListFiles(FFiles); if FFiles.Count > 0 then begin FFilename := FFiles[0]; {$IFDEF MSWINDOWS} {$ifdef JGO} if (Length(FFilename) > 2) and (FFilename[2] = DriveDelim) and (FFilename[3] = '\') then begin Drive := Copy(FFilename, 1, 3); {$else} if (Length(FFilename) > 1) and (FFilename[2] = DriveDelim) then begin Drive := Copy(FFilename, 1, 2); {$endif} DT := Windows.GetDriveType(PChar(Drive)); CanClose := (DT <> DRIVE_UNKNOWN) and (DT <> DRIVE_NO_ROOT_DIR); ...