function MinimizePathName(const Filename: String; const Font: TFont; MaxLen: Integer): String;
Returns a minimized filename that will not take more than MaxLen pixels to display with the given font. The minimizing is done by replacing the middle part with '...' as needed.
MyLabel.Caption := MinimizePathName(MyPathName, MyLabel.Font, MyLabel.Width);