Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 86785

Summary: [Program] Program.findProgram(<Extension>) doesn't find Icons for IconHandlers
Product: [Eclipse Project] Platform Reporter: Tiberiu Caprita <capritat>
Component: SWTAssignee: Steve Northover <snorthov>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: ovidr, Tod_Creasey
Version: 3.1   
Target Milestone: 3.3 M7   
Hardware: PC   
OS: Windows All   
Whiteboard:

Description Tiberiu Caprita CLA 2005-02-27 14:24:27 EST
A file Class may have specific Icons for every file, Windows then requiring in 
Registry a set as DefaultIcon=%1 . In such case, Program.findProgram(ext) 
doesn't get the Icon.
Sample:
this= Program  (id=33)
  command= ""C:\\Internet Explorer\\iexplore.exe" %1"
  iconName= ""%1""
  name= "HTML-Dokument"


Details (about .exe please see also Bug 61023):
I am interested in getting Icons of a file extensions (regardless if is a 
File which you can open or not), as it they are shown in Explorer. 

From how is written Program.getImageData() it is clear that is supposed
Program.iconName to be something as <FileName[,Nr]>

Program.getProgram() fills iconName with HKCR\<Class>\\DefaultIcon value.
Problem occurs when the file classes have Icon Handlers (see 
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/shellcc/platform/shell/programmersguide/shell_int/shell_int_extending/extensi
onhandlers/iconhandlers.asp
) and therefore DefaultIcon=%1 (to me is the case of .html) or by example when 
there is no DefaultIcon (.exe).
Then sure that getImageData() runs with wrong Input param.

Sometimes SWT Program doesn't find the default Action of a extension file 
(maybe even doesn't exist) -".dll" by example, so that Icon detection maybe 
would be better separate from Program instance.

In order to get Image Files, it is interesting to see if that ones couldn't be 
obtained with OleGetIconOfClass/OleGetIconOfFile (then will be nice to have 
these fct. in swt.dll).
Comment 1 Billy Biggs CLA 2005-05-26 11:26:52 EDT
I am having trouble understanding what you are requesting in this bug.  Do you
need icons for arbitrary executable files on the system (bug 4643), or icons for
arbitrary files on the system (that may not actually be programs)?
Comment 2 Tiberiu Caprita CLA 2005-08-12 09:36:11 EDT
I need to get the Icons for files, as they are seen in System (Windows Exlorer).
Comment 3 Steve Northover CLA 2007-02-05 10:51:10 EST
*** Bug 14043 has been marked as a duplicate of this bug. ***
Comment 4 Steve Northover CLA 2007-04-16 14:44:58 EDT
Fixed > 20070416