This code is not working, for me, with long name :
B4X:
Dim gdo1 As String = File.Combine("C:\Program Files\Windows Photo Viewer", "PhotoViewer.dll")
Dim gdo2 As String = "ImageView_Fullscreen"
Dim gdo3 As String = File.Combine(chemin, nom)
' or Dim gdo3 As String = """" & File.Combine(chemin, nom) & """"
Dim sh As Shell
Dim pathToExe As String = File.Combine("C:\Windows\System32", "rundll32.exe")
sh.Initialize("test", pathToExe, Array As String(gdo1, gdo2, gdo3))
sh.Run(-1)
As long as gdo3 is a short name (for example d:\temp\test.jpg) everything is working BUT with a long name (for example d:\te mp\text.jpg or d:\temp\te s t.jpg) it is not working.
Do you know a way to put long name in gdo3 or a way to find short name from long name ?
Thank you.
Same trouble this way :
B4X:
' Dim l As List
' l.Initialize()
' l.Add(gdo1)
' l.Add(gdo2)
' l.Add(gdo3)
' sh.Initialize("test", pathToExe, l)
The problem may come from Photoviewer.dll more than from Shell.
When I try this:
B4X:
Dim sh As Shell
Dim n As String = File.Combine("C:\Program Files", "Blender Foundation\Blender\2.77\python")
sh.InitializeDoNotHandleQuotes("", "explorer.exe", Array(n))
sh.Run(-1)
It all works fine, even with spaces. Maybe the Photoviewer.dll doesn't accept paths containing spaces? Did you look at the documentation?
Could you try with doubling the double quotes?
B4X:
sh.InitializeDoNotHandleQuotes("test", pathToExe, Array As String($"""${gdo1}"""$, $"""${gdo2}"""$, $"""${gdo3}"""$))
Edit:
Did you try calling directly Photoviewer like this:
The problem may come from Photoviewer.dll more than from Shell.
When I try this:
B4X:
Dim sh As Shell
Dim n As String = File.Combine("C:\Program Files", "Blender Foundation\Blender\2.77\python")
sh.InitializeDoNotHandleQuotes("", "explorer.exe", Array(n))
sh.Run(-1)
It all works fine, even with spaces. Maybe the Photoviewer.dll doesn't accept paths containing spaces? Did you look at the documentation?
Could you try with doubling the double quotes?
B4X:
sh.InitializeDoNotHandleQuotes("test", pathToExe, Array As String($"""${gdo1}"""$, $"""${gdo2}"""$, $"""${gdo3}"""$))
Edit:
Did you try calling directly Photoviewer like this: