OpenFileDialog
Verfasst: 17.01.2010 01:20
Wie kann ich OpenFileDialog so aufrufen, dass "Computer" - statt irgendein Startordner - vorausgewählt ist?
Code: Alles auswählen
#PB_SpecialFolder_Desktop = 0
#PB_SpecialFolder_Programs = 2
#PB_SpecialFolder_Personal = 5
#PB_SpecialFolder_Favorites = 6
#PB_SpecialFolder_StartUp = 7
#PB_SpecialFolder_Recent = 8
#PB_SpecialFolder_SendTo = 9
#PB_SpecialFolder_StartMenu = 11
#PB_SpecialFolder_Drives = 17
#PB_SpecialFolder_Nethood = 19
#PB_SpecialFolder_Fonts = 20
#PB_SpecialFolder_Templates = 21
Procedure.s GetSpecialFolder(Flag)
Protected *Buffer, Location$ = Space(#MAX_PATH)
If SHGetSpecialFolderLocation_ (0, Flag, @*Buffer) = #NOERROR
If SHGetPathFromIDList_ (*Buffer, @Location$)
If Right(Location$, 1) <> "\" : Location$ + "\" : EndIf
ProcedureReturn Location$
EndIf
EndIf
EndProcedure
OpenFileRequester("", GetSpecialFolder(#PB_SpecialFolder_Drives), "", 0)