Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 61023 - [Program] Program.getImageData() returns null for executables (*.exe files)
Summary: [Program] Program.getImageData() returns null for executables (*.exe files)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-05 08:18 EDT by Eugene Scripnik CLA
Modified: 2007-05-17 16:34 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Scripnik CLA 2004-05-05 08:18:25 EDT
It seems to me that executables are handled in some special way by Windows. 
This behavior causes Program.getImageData() to return null for them. But 
standard icon for exe files in Windows applications (Explorer) is blue window 
frame.
Is it possible for SWT Program to behave as it Explorer does for executables 
without embeded icons?
Comment 1 Tiberiu Caprita CLA 2005-02-25 11:36:37 EST
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.

I am more interested in getting Icons of a file extension (regardless if is a 
File which you can open or not). This thing (icon detection) is quite 
inappropiate to be connected to Program, as Program is defined as something 
that has <class>\"open"\command, where "open" could be also <class>\shell 
value. For "dllfile" class by example, there is no open cmd (at least not 
detected by getProgram()), but it has a DefaultIcon that could be find.

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).

Hint for the reported Bug: it could be used ".com" extension in order to get 
the default ".exe" icon.

I don't think is related to WindowsXp, I have W2000 and the problem occurs.
Comment 2 Bob Foster CLA 2005-03-19 21:29:05 EST
1. In addition to there being no icons for some files (like .exe) the wrong
icons are returned on Windows when the desktop icon differs from the default
icon in the registry.

2. Several icons (such as for .txt) have ugly black artifacts on the right side.
The corresponding icons presented by Windows Explorer have no such artifacts.
Comment 3 Steve Northover CLA 2007-04-16 14:44:30 EDT
Fixed > 20070416