I want to display a file tree similarly to java2s.com \'Create a lazy file tree\', but include the actual system icons - especially for folders. SWT does not seem to offer t
share you the code,it works ok for me.
/** extract the exe file's icon */
public static Image getImage4exe(String path) {
/* Use the character encoding for the default locale */
TCHAR lpszFile = new TCHAR(0, path, true);
long[] phiconSmall = new long[1];
OS.ExtractIconEx(lpszFile, 0, null, phiconSmall, 1);
if (phiconSmall[0] == 0) {
return null;
}
Image ret = Image.win32_new(null, SWT.ICON, phiconSmall[0]);
return ret;
}