The point is that in order to determine the number of pixels wide a certain string will be, you need information about the font used to render that string. I'm pretty sure that's all Furry Guy was saying.
Albatross,
yes, but that means to change the font (font size) of the status bar.
No, I onlyy want to know, if the string fits.
If not I shorten the string like this:
C:\Users\michael\Documents\.....\"Filename doesn't fit in statusbar"
And as I said ... Just to know the number of characters doesn't help
but that means to change the font (font size) of the status bar.
More than a few applications I have used truncate the displayed text, displaying "..." as the final 3 characters, if the number of characters exceeded the space allotted on the status bar. The apps "pop up" a tooltip that displays the entire string if the user hovers their pointer over the text.
Or find some other area of the app's window to display the information, such as the title bar. That isn't as common as displaying a tooltip.