Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
In my static text (in our startpage) in visual studio I can display path to my project like this below:
C:\MyProject\Something\FilesF...

I'd like to have dots inside the path to see the last catalogue.

What I have tried:

For my static text control I have set properties like this:
path ellipsis , word ellipsis ,End Ellipsis = true

Can I set this by properties or it should be done other way?
Posted
Updated 30-Nov-17 3:43am
Comments
Member 13495762 1-Dec-17 7:35am    
C:\MyProject\..\FilesForTeam

1 solution

You should not set all three properties but only one of them because they are exclusive:
#define SS_ENDELLIPSIS      0x00004000L
#define SS_PATHELLIPSIS     0x00008000L
#define SS_WORDELLIPSIS     0x0000C000L
#define SS_ELLIPSISMASK     0x0000C000L
So setting all of them is the same as SS_WORDELLIPSIS which results in ellipses at the end with pathes that did not contain spaces.

If you want to do it manually you can use the Shell PathCompactPath function (Windows)[^] function.
 
Share this answer
 
Comments
jeron1 30-Nov-17 11:05am    
Jochen, my apologies, I had a brain fart and meant to vote 5.
[edit] Strange, it didn't let me alter my vote right away, it should be fixed now. [/edit]
Jochen Arndt 30-Nov-17 11:10am    
No problem. I have enough points.

Thank you for voting up (now).
Member 13495762 1-Dec-17 7:34am    
I need to have it this way:
C:\MyProject\..\FilesForTeam
Jochen Arndt 1-Dec-17 7:58am    
Have you followed my advice to use SS_PATHELLIPSIS (set the corresponding property in the resource editor and unset the Word and End ellipsis properties)?

You can also do it programmatically by calling the member function ModifyStyle(SS_ELLIPSISMASK, SS_PATHELLIPSIS) of your static control.

However, that and the PathCompactPath() function will preserve as many characters as possible creating also something like " C:\MyProject\Some...\FilesForTeam".

If you don't want that, you have to write your own function.
Member 13495762 1-Dec-17 8:07am    
I put in resourse.h
#define SS_PATHELLIPSIS 0x00008000L
In visual studio I set the static box properties - > false, and it didn't work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900