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.