sysiconutils.h

来自「7-Zip 是一款号称有着现今最高压缩比的压缩软件」· C头文件 代码 · 共 52 行

H
52
字号
// SysIconUtils.h

#ifndef __SYSICONUTILS_H
#define __SYSICONUTILS_H

#include "Common/MyString.h"

struct CExtIconPair
{
  UString Ext;
  int IconIndex;
  UString TypeName;

};

inline bool operator==(const CExtIconPair &a1, const CExtIconPair &a2)
{
  return (a1.Ext == a2.Ext);
}

inline bool operator<(const CExtIconPair &a1, const CExtIconPair &a2)
{
  return (a1.Ext < a2.Ext);
}

class CExtToIconMap
{
  int _dirIconIndex;
  UString _dirTypeName;
  int _noExtIconIndex;
  UString _noExtTypeName;
  CObjectVector<CExtIconPair> _map;
public:
  CExtToIconMap(): _dirIconIndex(-1), _noExtIconIndex(-1) {}
  void Clear()
  {
    _dirIconIndex = -1;
    _noExtIconIndex = -1;
    _map.Clear();
  }
  int GetIconIndex(UINT32 attributes, const UString &fileName, UString &typeName);
  int GetIconIndex(UINT32 attributes, const UString &fileName);
};

DWORD_PTR GetRealIconIndex(LPCTSTR path, DWORD attributes, int &iconIndex);
#ifndef _UNICODE
DWORD_PTR GetRealIconIndex(LPCWSTR path, DWORD attributes, int &iconIndex);
#endif
int GetIconIndexForCSIDL(int csidl);

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?