Ver 2.0 :ExplorerList Gadget with Large Icons [Windows]
Posted: Sun Oct 05, 2014 7:20 pm
Tested with PB 5.30 x 86 XP SP2 - Windows 7 x86 - Windows 8.1 x64
- Use any size more than 32
- Do not delete IconCache.db in windows 8.1
Edit :More enhancement
Edit 2:More enhancement
Edit 3:Modified
- Use any size more than 32
- Do not delete IconCache.db in windows 8.1
Code: Select all
Procedure Resizewindow_EX()
ResizeWindow(0,#PB_Ignore,#PB_Ignore,WindowWidth(0), WindowHeight(0))
ResizeGadget(0,#PB_Ignore,#PB_Ignore,#PB_Ignore, WindowHeight(0)-20)
ResizeGadget(1,#PB_Ignore,#PB_Ignore,WindowWidth(0)-230,WindowHeight(0)-20)
ResizeGadget(2,#PB_Ignore,#PB_Ignore,WindowWidth(0)-20,WindowHeight(0)-20)
EndProcedure
OpenLibrary(0,"Shell32.dll")
*FileIconInit = GetFunctionEntry(0,660)
*SystemGetIL = GetFunctionEntry(0,71)
If CallFunctionFast(*FileIconInit,1)
CallFunctionFast(*SystemGetIL,@LargeIL,@SmallIL)
EndIf
Count = ImageList_GetImageCount_(LargeIL) - 1
newLargeIL = ImageList_Create_(64,64,#ILC_COLOR32| #ILC_MASK, 0, Count)
Icon_0 = ImageList_GetIcon_(LargeIL,0,#ILD_NORMAL)
For x = 0 To Count
If ImageList_GetIcon_(LargeIL,x,#ILD_NORMAL) = 0
ImageList_AddIcon_(newLargeIL,ImageList_GetIcon_(LargeIL,0, #ILD_NORMAL))
Else
ImageList_AddIcon_(newLargeIL,ImageList_GetIcon_(LargeIL,x, #ILD_NORMAL))
EndIf
Next
If OpenWindow(0,0,0,600,400,"Large Image List",#PB_Window_SystemMenu| #PB_Window_ScreenCentered| #PB_Window_SizeGadget)
ExplorerTreeGadget(0, 0,0,0,0, "*.*")
ExplorerListGadget(1,0,0,0,0, "*.*",#PB_Explorer_NoFolders |#LVS_SHAREIMAGELISTS)
SplitterGadget(2, 10, 10, 580, 380, 0,1, #PB_Splitter_Vertical|#PB_Splitter_Separator)
SetGadgetState(2,180)
SendMessage_(GadgetID(1),#LVM_SETVIEW,#LV_VIEW_ICON,0)
SendMessage_(GadgetID(1),#LVM_SETIMAGELIST,#LVSIL_NORMAL, newLargeIL)
BindEvent(#PB_Event_SizeWindow,@Resizewindow_EX())
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
ImageList_Destroy_(newLargeIL)
Quit = 1
Case #PB_Event_Gadget
Select EventGadget()
Case 0
Select EventType()
Case #PB_EventType_Change
SetGadgetText(1,"*.*")
Text$ = GetGadgetText(0)
SetGadgetText(1,Text$)
EndSelect
Case 1
Select EventType()
Case #PB_EventType_LeftDoubleClick
ShellExecute_(0,"open",GetGadgetText(1)+GetGadgetItemText(1, GetGadgetState(1) ,0),0,0,1)
EndSelect
EndSelect
EndSelect
Until Quit = 1
If IsLibrary(0)
CloseLibrary(0)
EndIf
EndIf
Edit 2:More enhancement
Edit 3:Modified