File: SysIconUtils.h

package info (click to toggle)
lzma 24.08%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,472 kB
  • sloc: cpp: 78,089; ansic: 26,903; asm: 4,195; cs: 3,846; java: 3,077; makefile: 1,010; sh: 74
file content (65 lines) | stat: -rw-r--r-- 1,688 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// SysIconUtils.h

#ifndef ZIP7_INC_SYS_ICON_UTILS_H
#define ZIP7_INC_SYS_ICON_UTILS_H

#include "../../../Common/MyWindows.h"

#include <CommCtrl.h>

#include "../../../Common/MyString.h"

struct CExtIconPair
{
  UString Ext;
  int IconIndex;
  // UString TypeName;
  // int Compare(const CExtIconPair &a) const { return MyStringCompareNoCase(Ext, a.Ext); }
};

struct CAttribIconPair
{
  DWORD Attrib;
  int IconIndex;
  // UString TypeName;
  // int Compare(const CAttribIconPair &a) const { return Ext.Compare(a.Ext); }
};


struct CExtToIconMap
{
  CRecordVector<CAttribIconPair> _attribMap;
  CObjectVector<CExtIconPair> _extMap_Normal;
  CObjectVector<CExtIconPair> _extMap_Compressed;
  int SplitIconIndex;
  int SplitIconIndex_Defined;
  
  CExtToIconMap(): SplitIconIndex_Defined(false) {}

  void Clear()
  {
    SplitIconIndex_Defined = false;
    _extMap_Normal.Clear();
    _extMap_Compressed.Clear();
    _attribMap.Clear();
  }
  int GetIconIndex_DIR(DWORD attrib = FILE_ATTRIBUTE_DIRECTORY)
  {
    return GetIconIndex(attrib, L"__DIR__");
  }
  int GetIconIndex(DWORD attrib, const wchar_t *fileName /* , UString *typeName */);
};

extern CExtToIconMap g_Ext_to_Icon_Map;

DWORD_PTR Shell_GetFileInfo_SysIconIndex_for_Path_attrib_iconIndexRef(
    CFSTR path, DWORD attrib, int &iconIndex);
HRESULT Shell_GetFileInfo_SysIconIndex_for_Path_return_HRESULT(
    CFSTR path, DWORD attrib, Int32 *iconIndex);
int Shell_GetFileInfo_SysIconIndex_for_Path(CFSTR path, DWORD attrib);

int Shell_GetFileInfo_SysIconIndex_for_CSIDL(int csidl);

HIMAGELIST Shell_Get_SysImageList_smallIcons(bool smallIcons);

#endif