예제 #1
0
		public static System.Drawing.Icon GetSystemIcon(string filename)
		{
			SHFILEINFO shFileInfoSmallIcon = new SHFILEINFO();
			IntPtr hSmallIcon = WindowsAPI.SHGetFileInfo(filename, 0, ref shFileInfoSmallIcon, (uint)Marshal.SizeOf(shFileInfoSmallIcon), WindowsAPI.SHGFI_ICON | WindowsAPI.SHGFI_SMALLICON | WindowsAPI.SHGFI_USEFILEATTRIBUTES);
			return System.Drawing.Icon.FromHandle(shFileInfoSmallIcon.hIcon);
		}
예제 #2
0
		public static extern IntPtr SHGetFileInfo(string pszPath,
			uint dwFileAttributes,
			ref SHFILEINFO psfi,
			uint cbSizeFileInfo,
			uint uFlags);