using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Runtime.InteropServices;
namespace Fine.RefAPI
{
public class FileHelper
{
#region 取得檔案中包含的所有圖標
[DllImport("shell32.dll", CharSet = CharSet.Auto)]
private static extern int ExtractIconEx(string path, int i, IntPtr[] big, IntPtr[] small, uint op);
/// <summary>
/// Get file contain's all icons
/// </summary>
/// <param name="FilePath">file path</param>
/// <returns>icon</returns>
static public Icon[] GetFileIcons(string FilePath)
{
try
{
int IconsNum = ExtractIconEx(FilePath, -1, null, null, 0); //get file icons count
if (IconsNum <= 0)
return null;
IntPtr[] LargeIcons = new IntPtr[IconsNum];
IntPtr[] SmallIcons = new IntPtr[IconsNum];
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载