从Eclipse MarketPlace 下载Windows Builder
所有控件的实例如下:
https://www.eclipse.org/swt/snippets/
1.如何提取可执行文件exe的图标
/** 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; }
看我在stackoverflow的答复:
How to display system icon for a file in SWT?
SWT/JFACE源码下载