예제 #1
0
 public static IntPtr getIcon(String absolutePath, Boolean getLargeIcon) 
 {
     ShellApi.SHFILEINFO shinfo = new ShellApi.SHFILEINFO();
     if (ShellApi.SHGetFileInfo(absolutePath, 0, out shinfo, (uint)Marshal.SizeOf(shinfo), ShellApi.SHGFI.SHGFI_ICON | (getLargeIcon ? ShellApi.SHGFI.SHGFI_LARGEICON : ShellApi.SHGFI.SHGFI_SMALLICON)) == IntPtr.Zero)
     {
         return IntPtr.Zero;
     }
     return shinfo.hIcon;
 }
예제 #2
0
		public static int getAttribute(string path)
		{
            ShellApi.SHFILEINFO shinfo = new ShellApi.SHFILEINFO();
            if (ShellApi.SHGetFileInfo(path, 0, out shinfo, (uint)Marshal.SizeOf(shinfo), ShellApi.SHGFI.SHGFI_ATTRIBUTES) == IntPtr.Zero)
			{
				return 0;
			}
			return (int)shinfo.dwAttributes;
		}
예제 #3
0
		public static String getFolderType(IntPtr pIDL)
        {
            ShellApi.SHFILEINFO fileInfo = new ShellApi.SHFILEINFO();
            ShellApi.SHGetFileInfo(pIDL, 0, out fileInfo, (uint)Marshal.SizeOf(fileInfo), ShellApi.SHGFI.SHGFI_PIDL | ShellApi.SHGFI.SHGFI_TYPENAME);
            return fileInfo.szTypeName;
        }
예제 #4
0
		public static string getFolderType(string path)
		{
            ShellApi.SHFILEINFO shinfo = new ShellApi.SHFILEINFO();
			if (ShellApi.SHGetFileInfo(path, 0, out shinfo, (uint)Marshal.SizeOf(shinfo), ShellApi.SHGFI.SHGFI_TYPENAME) == IntPtr.Zero)
			{
				return null;
			}
			return shinfo.szTypeName;
		}