Page 1 of 1
ExplorerListGadget - nada icons for *.exe
Posted: Wed Dec 14, 2011 8:04 pm
by Danilo
Code: Select all
If OpenWindow(0,0,0,450,500,"ExplorerListGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ExplorerListGadget(0, 0, 0, 450, 500, "C:\*.exe;*.dll;*.ico",#PB_Explorer_FullRowSelect)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Does not display the *.exe icons with PureBasic 4.60 x86.
Displays *.exe icons with PB 4.60 x64.
Icons for other file types are displayed, but not the *.exe icons.
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Thu Dec 15, 2011 10:42 am
by Shardik
Danilo wrote:Does not display the *.exe icons with PureBasic 4.60 x86.
I can't confirm this finding. All icons of .exe files are displayed correctly
using Danilo's example code.
Tested systems:
Windows 7 SP1 Enterprise Edition x86 (updated with Microsoft's newest patches from Tuesday just before testing

)
Windows XP SP3 Professional x86
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Thu Dec 15, 2011 10:55 am
by Lord
Danilo wrote:Does not display the *.exe icons with PureBasic 4.60 x86.
I can't confirm this finding, too.
PB4.60(x68) and PB4.60(x64) are showing the same Icons.
My OS:
Windows 7 Ultimate - SP1
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Thu Dec 15, 2011 11:38 am
by Danilo
My OS: Windows 7 Ultimate 64bit - SP1 - all windows updates (last updated yesterday).
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Thu Dec 15, 2011 12:00 pm
by ts-soft
My OS: Windows 7 Ultimate 64bit - SP1 - all windows updates (last updated yesterday).
I can't confirm this
Greetings - Thomas
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Thu Dec 15, 2011 12:35 pm
by einander

_______________________________
Using Danilo's example code.
PureBasic 4.60 (Windows - x86)
My OS: Windows 7 Ultimate 32bit - SP1 - all windows updates (last updated yesterday).
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Thu Dec 15, 2011 4:07 pm
by IdeasVacuum
..... as a 32bit app, it will not display exe icons that are 64bit? Similar to Windows Explorer on 32bit - if you place a 64bit app anywhere, Windows does not display the icon.
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Fri Dec 30, 2011 12:47 pm
by Fred
Seems to work fine here (Win 7 64 bit, using PB x86). Can anybody else confirm ?
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Tue Jan 03, 2012 3:02 pm
by Trond
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Tue Jan 03, 2012 4:01 pm
by Danilo
Trond wrote:Have you tried to rebuild the icon cache?
Thank you, but did not work. All icons show fine, except .EXE icons
in PB's ExplorerListGadget.
I think it is how PB extracts the icons from .EXEs.
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Tue Apr 10, 2012 4:23 pm
by Fred
We do use the regular SHGetFileInfo() function. May be you can test on your computer to see if it returns an icon.
Here is the C code:
Code: Select all
ZeroMemory(&shFileInfo, sizeof(SHFILEINFO));
SHGetFileInfo(Filename, 0, &shFileInfo, sizeof(SHFILEINFO), SHGFI_TYPENAME | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
strcpy(ResultBuffer, &shFileInfo.szTypeName[0]);
*TypeName = ResultBuffer;
return shFileInfo.iIcon;
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Tue Oct 16, 2012 11:54 am
by Fred
Any chances ?
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Tue Oct 16, 2012 3:56 pm
by einander
Danilo's code still displays correctly all the .exe icons.
PureBasic 5.00 beta 5 (Windows - x86)
My OS: Windows 7 Ultimate 32bit - SP1 - all windows updates.
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Thu Oct 25, 2012 6:34 am
by Danilo
Fred wrote:Any chances ?
It still does not work here on my system. OpenFileRequester() with PB 32bit does not show
.EXE icons too, so it looks like an issue with my system only, not directly a PureBasic bug.
Tested code on Win 7 64bit Ultimate, using PureBasic 4.61 x86:
Code: Select all
;
; http://www.purebasic.fr/english/viewtopic.php?f=4&t=48559
;
CoInitialize_(0) ; required for SHGetFileInfo_()
;InitCommonControlsEx_()
;FileIconInit_(0)
lib = LoadLibrary_("shell32.dll")
If lib
address = GetProcAddress_(lib,660)
If address
Debug "Calling FileIconInit"
CallFunctionFast(address,1)
EndIf
EndIf
If OpenWindow(0,0,0,450,500,"ExplorerListGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ExplorerListGadget(0, 0, 0, 450, 500, "C:\*.exe;*.dll;*.ico");,#PB_Explorer_FullRowSelect)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Procedure ShowIcon(hIcon)
OpenWindow(0,0,0,200,200,"Icon",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ImageGadget(0,0,0,200,200,hIcon)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndProcedure
Procedure Info( Filename.s )
shFileInfo.SHFILEINFO
Debug Filename
Debug SHGetFileInfo_(@Filename, 0, @shFileInfo, SizeOf(SHFILEINFO), #SHGFI_TYPENAME | #SHGFI_SYSICONINDEX | #SHGFI_SMALLICON );| #SHGFI_ICON)
Debug shFileInfo\iIcon
Debug shFileInfo\hIcon
Debug PeekS(@shFileInfo\szTypeName[0])
EndProcedure
Procedure Info2( Filename.s )
shFileInfo.SHFILEINFO
Debug Filename
Debug SHGetFileInfo_(@Filename, 0, @shFileInfo, SizeOf(SHFILEINFO), #SHGFI_TYPENAME | #SHGFI_SYSICONINDEX | #SHGFI_SMALLICON | #SHGFI_DISPLAYNAME )
Debug shFileInfo\iIcon
Debug shFileInfo\hIcon
Debug PeekS(@shFileInfo\szTypeName[0])
Debug PeekS(@shFileInfo\szDisplayName[0])
If GetExtensionPart(Filename)="exe"
;
; extract icon
;
shFileInfo\hIcon = ExtractIcon_(0,@Filename,0)
If shFileInfo\hIcon > 1
ShowIcon(shFileInfo\hIcon)
DestroyIcon_(shFileInfo\hIcon)
EndIf
;
; extract big icon
;
If ExtractIconEx_(@Filename,0,@shFileInfo\hIcon,0,1)
ShowIcon(shFileInfo\hIcon)
DestroyIcon_(shFileInfo\hIcon)
EndIf
;
; extract small icon
;
If ExtractIconEx_(@Filename,0,0,@shFileInfo\hIcon,1)
ShowIcon(shFileInfo\hIcon)
DestroyIcon_(shFileInfo\hIcon)
EndIf
EndIf
hIcon = ExtractAssociatedIcon_(0,@FileName,@w.w)
If hIcon
ShowIcon(hIcon)
DestroyIcon_(hIcon)
EndIf
EndProcedure
Info( "c:\Windows\calc.exe" )
Debug "-----------------"
Info( "c:\Windows\advapi32.dll" )
Debug "-----------------"
Info2( "c:\Windows\calc.exe" )
Debug "-----------------"
Info2( "c:\Windows\advapi32.dll" )
CoUninitialize_()
My Debugger output:
Code: Select all
Calling FileIconInit
c:\Windows\calc.exe
5927960
0
0
Application
-----------------
c:\Windows\advapi32.dll
5927960
179
0
Application extension
-----------------
c:\Windows\calc.exe
5927960
0
0
Application
calc
-----------------
c:\Windows\advapi32.dll
5927960
179
0
Application extension
advapi32.dll
So the only 'workaround' would be to use ExtractIcon_(), ExtractIconEx_() (with small and big icons)
and maybe ExtractAssociatedIcon_() to get the real .EXE icon.
If this functions do not return a icon (the .EXE does not have an internal icon), use the System Image List icon returned by SHGetFileInfo_().
Looks like I am the only one having this issue, so I wouldn't call it an important bug. I am running this system
for a long time (when Win7 came out) and installed quite a lot of big commercial applications over that time,
so it could be a system issue just here on my system.
Re: [4.60 x86] ExplorerListGadget - nada icons for *.exe
Posted: Thu Oct 25, 2012 9:41 am
by Fred
If the regular OpenRequester() doesn't display the icons as well, we can conclude there is something wrong with your setup, i don't think it worths a workaround.