PB 5.10 SHGetFileInfo_() API crash - x64
Posted: Thu Feb 21, 2013 4:38 pm
I don't know if the crash comes from API or structure or ...
The following code works in x86 mode unicode or not.
It crashes in x64 mode unicode or not with or without register key value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management set or not (AllocationPreference"=dword:00100000).
Obviously i've restarded my computer after register change.
But now, uncomment line with ExplorerTreeGadget or ExplorerListGadget or ExplorerComboGadget.
Run it and it works, no x64 crash.
A shell ImageList problem ?
The following code works in x86 mode unicode or not.
It crashes in x64 mode unicode or not with or without register key value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management set or not (AllocationPreference"=dword:00100000).
Obviously i've restarded my computer after register change.
But now, uncomment line with ExplorerTreeGadget or ExplorerListGadget or ExplorerComboGadget.
Run it and it works, no x64 crash.
A shell ImageList problem ?
Code: Select all
Global Path$ = "C:\"
Global info.SHFILEINFO
#Listicon = 0
If OpenWindow(0, 100, 100, 600, 300, "ListIconGadget", #PB_Window_MaximizeGadget| #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(#Listicon, 0, 0, 300, WindowHeight(0)-30, "Element", 200)
; ExplorerTreeGadget(5, 310, 0, 290, WindowHeight(0)-30, Path$, #PB_Explorer_NoFiles)
; ExplorerListGadget(5, 310, 0, 290, WindowHeight(0)-30, Path$, #PB_Explorer_NoFiles)
; ExplorerComboGadget(5, 310, 0, 290, WindowHeight(0)-30, Path$, #PB_Explorer_NoFiles)
If ExamineDirectory(0, Path$, "*.*")
While NextDirectoryEntry(0)
If DirectoryEntryType(0) = #PB_DirectoryEntry_File
If SHGetFileInfo_(Path$ + DirectoryEntryName(0), 0, @info.SHFILEINFO, SizeOf(SHFILEINFO), #SHGFI_ICON|#SHGFI_LARGEICON)
AddGadgetItem(#Listicon, -1, DirectoryEntryName(0), info\hIcon)
DestroyIcon_(info\hIcon)
Else
AddGadgetItem(#Listicon, -1, DirectoryEntryName(0))
EndIf
EndIf
Wend
FinishDirectory(0)
EndIf
EndIf
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow