Community
Participate
Working Groups
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?
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.
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.
Fixed > 20070416