I have a ListBox that contains a list of file paths. In the OnDrawItem event I need to show as much of the path string as possible given the width of the ListBox.
For example, I need to convert:
to something like
if that's all that will fit in the ListBox width.
Can someone provide a standalone function to do this? (Meaning that I don't want to have to use the FileCtrl or ShellAPI units).