I presume that the function getDesktopPath returns a string ending with a Chr(0) character (as many API calls do), which marks the end of a string for most controls etc - in which case it is not a bug at all, just 'bad' code.

If you show us the code for getDesktopPath, we can help you correct it.