If you want to open Paint with a file from your application, it’s better to convert the path of the file you want to open from long to short names. Doing so is wise because in some situations-if your path contains spaces, for example-Paint may refuse to work properly. Before passing a file name to Paint, convert it to short names with this routine, which takes advantage of the Win32 API:
Declare Function GetShortPathName Lib "kernel32" Alias _ "GetShortPathNameA" (ByVal lpszLongPath As String, _ ByVal lpszShortPath As String, _ ByVal cchBuffer As Long) As LongFunction ShortName(LongPath As String) As String Dim ShortPath As String Const MAX_PATH = 260 Dim ret& ShortPath = Space$(MAX_PATH) ret& = GetShortPathName(LongPath, ShortPath, MAX_PATH) If ret& Then ShortName = Left$(ShortPath, ret&) End IfEnd Function
This trick may prove useful with any application you pass file names to. It would be smart to try passing “strange” file names/paths to make sure.