Therea re many times when we need to offer the user the highest level selection point on a Windows system (think root on macOS or Linux). This is to focus on showing the user all of the volumes mounted on the system, rather than just some subfolder.
Since there is no simple way to set the InitialFolder of an OpenFileDialog to “This PC” without serious coding gymnastics, it would be nice to have such an option in the SpecialFolder class.
If someone has a method for extending SpecialFolder or a separate method for defining it, I would be happy to create a proper Class extension and share it. Or, am I off to Feature Request dead zone?
As Arnaud said, such place does not exist, it is a snapshot emulated via coding gymnastics as you said. But you can move the explorer to there using this “path” ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
It is so Windows centric that such thing does not deserve a “SpecialFolder.ThisComputer”
Create you own function ThisComputerFolder as
Public Function ThisComputerFolder() As FolderItem
#If TargetWindows Then
Return New FolderItem("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", FolderItem.PathModes.Native)
#Else
Return Nil
#EndIf
End Function
Example:
Var dlg As New SelectFolderDialog
dlg.ActionButtonCaption = "Select"
dlg.Title = "This Computer 'folder'"
dlg.PromptText = "Pick a place"
dlg.InitialFolder = ThisComputerFolder()
Var f As FolderItem
f = dlg.ShowModal
If f <> Nil Then
// Use the folderitem here
Else
// User cancelled
End If
// For My Computer
New FolderItem("::{20d04fe0-3aea-1069-a2d8-08002b30309d}", FolderItem.PathModes.Native)
// For My Documents
New FolderItem("::{450d8fba-ad25-11d0-98a8-0800361b1103}", FolderItem.PathModes.Native)
// For My Network places (warning, may be slow to show up)
New FolderItem("::{208d2c60-3aea-1069-a2d7-08002b30309d}", FolderItem.PathModes.Native)