This question contains a combonation of Windows SBS 2003 sharepoint services and VB.
I drag a filename from a FileListBox to a PictureBox (the picturebox contains a picture of a pencil - this control is only used as a conduit for executing the editing process). The OLEDragDrop event is fired and the sub loads the file into mspaint for editing. This works fine for any long filenames and long directory names in "normal" directories (see GetShortFileName in your search), but we are now using folders in sharepoint services on a Windows 2003 Server (i.e. \\companyweb\somedirectory). Let's say we have a filepathname of "\\companyweb\somefolder\some sub folder with spaces in the name\somefile.bmp". Now the "shelled" mspaint app throws an error "\\companyweb\somefolder\some.bmp was not found." It only takes up to the first space of the subfolder name (if there are spaces in the name), truncates, and then appends the .bmp. It is as if there is no short name for the sharepoint folders.
This code works fine, including the GetShortFileName, but bombs in sharepoint \\companyweb\ folders:
Private Sub picEdit_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, Y As Single)
Dim mhWndApp As Long
Dim hInst As Long
hInst = Shell("mspaint.exe " & GetShortFileName(Data.Files(1)), vbMaximizedFocus)
mhWndApp = GetWinHandle(hInst)
lR = SetTopMostWindow(mhWndApp, True)
Why? And what's the solution?