Click to See Complete Forum and Search --> : Fitting paths into static text area


Joachim Bartz
March 29th, 1999, 09:47 AM
Hi!


I would like to show some path information in a static text area

but when the path gets too long, it will be cut off.


M$ sometimes uses three dots to shorten the information like this:

C:\Programs\Microsoft Office\Office\Outlook\blabla.dat

will be transformed into

C:\Programs\...\Outlook\blabla.dat


Is there a CStatic derived class doing this job available?

Yves
March 29th, 1999, 09:50 AM
Yes,

See http://www.codeguru.com/staticctrl/cstatic_filespec.shtml


-yves

Dave Lorde
March 29th, 1999, 10:03 AM
Use PathCompactPath or PathCompactPathEx.


Dave

Joachim Bartz
March 29th, 1999, 10:36 AM
Hi again.


First: Thanks a lot for the fast response!


Second: Am I wrong or are these API functions first available in

VC++ 6.0? I have to use VC 4.2b due to an error in the vc6 release

mode.


At the moment I prefer the the CStatic_FileSpec-Class from the

other resonse. It uses DrawTextEx() together with an (undocumented?!?)

style named DT_PATH_ELLIPSIS.


Joachim

Dave Lorde
March 30th, 1999, 03:29 AM
> Am I wrong or are these API functions first available in VC++ 6.0?


I don't think they are specific to VC++ 6.0, they are part of the Internet CLient SDK (also known as the Internet Explorer 4.0 Author's Toolkit) which was synched with the final release of MS Internet Explorer 4.0. I think they were supplied with VC++ 6.0, having been previously available separately.


> At the moment I prefer the the CStatic_FileSpec-Class from the other resonse


If the alternative approach is better suited, go for it :-)


Dave