I need to convert a long file name eg. "c:\This is a long\Path that needs to be converted to\an 8.3 format\my file.txt"

It would look something like this:

"c:\thisis~1\Pathth~1\needst~1\an83fo~1\myfile.txt"


I am aware of "GetShortPath" API call but it does not fit my purposes.

Is there any existing solution, or must i create my own?