@Velindos
Falls du ExplorerComboGadget() doch für Files brauchst:
Code: Alles auswählen
EnableExplicit
Define EventID
Global NewList hIcons()
Procedure FreehIcons()
ForEach hIcons()
DestroyIcon_(hIcons())
Next
EndProcedure
Procedure GetExtensionIcon(File$)
Protected SHFILEINFO.SHFILEINFO
Protected hIcon
If SHGetFileInfo_(@File$, #FILE_ATTRIBUTE_NORMAL, @SHFILEINFO, SizeOf(SHFILEINFO), #SHGFI_SMALLICON | #SHGFI_ICON)
hIcon = SHFILEINFO\hIcon
AddElement(hIcons())
hIcons() = hIcon
ProcedureReturn hIcon
EndIf
EndProcedure
Procedure ExplorerComboGadgetEx(Gadget, x, y, Width, Height, Directory$, Plattern$, Flags = 0)
Protected ExamDir
ComboBoxGadget(Gadget, x, y, Width, Height, #PB_ComboBox_Image | Flags)
ExamDir = ExamineDirectory(#PB_Any, Directory$, Plattern$)
If ExamDir
While NextDirectoryEntry(ExamDir)
If DirectoryEntryType(ExamDir) = #PB_DirectoryEntry_File
AddGadgetItem(Gadget, -1, DirectoryEntryName(ExamDir), GetExtensionIcon(Directory$ + DirectoryEntryName(ExamDir)), 0)
EndIf
Wend
FinishDirectory(ExamDir)
EndIf
SetGadgetState(Gadget, 0)
EndProcedure
If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ExplorerComboGadgetEx(1, 10, 10, 200, 20, "C:\", "*.*", 0)
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_CloseWindow
FreehIcons()
End
EndIf
ForEver
EndIf