📄 shlobj.h
字号:
STDMETHOD(Extract)(THIS_
LPCWSTR pszFile,
UINT nIconIndex,
HICON *phiconLarge,
HICON *phiconSmall,
UINT nIconSize) PURE;
};
typedef IExtractIconW * LPEXTRACTICONW;
#ifdef UNICODE
#define IExtractIcon IExtractIconW
#define IExtractIconVtbl IExtractIconWVtbl
#define LPEXTRACTICON LPEXTRACTICONW
#else
#define IExtractIcon IExtractIconA
#define IExtractIconVtbl IExtractIconAVtbl
#define LPEXTRACTICON LPEXTRACTICONA
#endif
//===========================================================================
//
// IShellIcon Interface
//
// used to get a icon index for a IShellFolder object.
//
// this interface can be implemented by a IShellFolder, as a quick way to
// return the icon for a object in the folder.
//
// a instance of this interface is only created once for the folder, unlike
// IExtractIcon witch is created once for each object.
//
// if a ShellFolder does not implement this interface, the standard
// GetUIObject(....IExtractIcon) method will be used to get a icon
// for all objects.
//
// the following standard imagelist indexs can be returned:
//
// 0 document (blank page) (not associated)
// 1 document (with stuff on the page)
// 2 application (exe, com, bat)
// 3 folder (plain)
// 4 folder (open)
//
// IShellIcon:GetIconOf(pidl, flags, lpIconIndex)
//
// pidl object to get icon for.
// flags GIL_* input flags (GIL_OPEN, ...)
// lpIconIndex place to return icon index.
//
// returns:
// NOERROR, if lpIconIndex contains the correct system imagelist index.
// S_FALSE, if unable to get icon for this object, go through
// GetUIObject, IExtractIcon, methods.
//
//===========================================================================
#undef INTERFACE
#define INTERFACE IShellIcon
DECLARE_INTERFACE_(IShellIcon, IUnknown) // shi
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IShellIcon methods ***
STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT flags,
LPINT lpIconIndex) PURE;
};
typedef IShellIcon *LPSHELLICON;
//===========================================================================
//
// IShellIconOverlayIdentifier
//
// Used to identify a file as a member of the group of files that have this specific
// icon overlay
//
// Users can create new IconOverlayIdentifiers and place them in the following registry
// location together with the Icon overlay image and their priority.
// HKEY_LOCAL_MACHINE "Software\\Microsoft\\Windows\\CurrentVersion\\ShellIconOverlayIdentifiers"
//
// The shell will enumerate through all IconOverlayIdentifiers at start, and prioritize
// them according to internal rules, in case the internal rules don't apply, we use their
// input priority
//
// IShellIconOverlayIdentifier:IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib)
// pwszPath full path of the file
// dwAttrib attribute of this file
//
// returns:
// S_OK, if the file is a member
// S_FALSE, if the file is not a member
// E_FAIL, if the operation failed due to bad WIN32_FIND_DATA
//
// IShellIconOverlayIdentifier::GetOverlayInfo(LPWSTR pwszIconFile, int * pIndex, DWORD * dwFlags) PURE;
// pszIconFile the path of the icon file
// pIndex Depend on the flags, this could contain the IconIndex
// dwFlags defined below
//
// IShellIconOverlayIdentifier::GetPriority(int * pIPriority) PURE;
// pIPriority the priority of this Overlay Identifier
//
//===========================================================================
#undef INTERFACE
#define INTERFACE IShellIconOverlayIdentifier
DECLARE_INTERFACE_(IShellIconOverlayIdentifier, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IShellIconOverlayIdentifier methods ***
STDMETHOD (IsMemberOf)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib) PURE;
STDMETHOD (GetOverlayInfo)(THIS_ LPWSTR pwszIconFile, int cchMax, int * pIndex, DWORD * pdwFlags) PURE;
STDMETHOD (GetPriority)(THIS_ int * pIPriority) PURE;
};
#define ISIOI_ICONFILE 0x00000001 // path is returned through pwszIconFile
#define ISIOI_ICONINDEX 0x00000002 // icon index in pwszIconFile is returned through pIndex
//===========================================================================
//
// IShellIconOverlay
//
// Used to return the icon overlay index or its icon index for an IShellFolder object,
// this is always implemented with IShellFolder
//
// IShellIconOverlay:GetOverlayIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
// pidl object to identify icon overlay for.
// pdwIndex the Overlay Index in the system image list
//
// IShellIconOverlay:GetOverlayIconIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
// pdwIconIndex the Overlay Icon index in the system image list
// This method is only used for those who are interested in seeing the real bits
// of the Overlay Icon
//
// returns:
// S_OK, if the index of an Overlay is found
// S_FALSE, if no Overlay exists for this file
// E_FAIL, if pidl is bad
//
//===========================================================================
#undef INTERFACE
#define INTERFACE IShellIconOverlay
DECLARE_INTERFACE_(IShellIconOverlay, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IShellIconOverlay methods ***
STDMETHOD(GetOverlayIndex)(THIS_ LPCITEMIDLIST pidl, int * pIndex) PURE;
STDMETHOD(GetOverlayIconIndex)(THIS_ LPCITEMIDLIST pidl, int * pIconIndex) PURE;
};
#define OI_ASYNC 0xFFFFEEEE
//-------------------------------------------------------------------------
//
// SHGetIconOverlayIndex
//
// This function takes the path and icon/res id to the icon and convert it into
// an overlay index in the system image list.
// Note: there are totally only 15 slots for system image overlays, some of which
// was reserved by the system, or taken by the overlayidentifiers, so it's possible
// that this function would fail and return -1;
//
// To get the default overlays in the system, such as the share hand, link shortcut
// and slow files, pass NULL as the file name, then the IDO_SHGIOI_* flags as the icon index
//-------------------------------------------------------------------------
#define IDO_SHGIOI_SHARE 0x0FFFFFFF
#define IDO_SHGIOI_LINK 0x0FFFFFFE
#define IDO_SHGIOI_SLOWFILE 0x0FFFFFFFD
SHSTDAPI_(int) SHGetIconOverlayIndexA(LPCSTR pszIconPath, int iIconIndex);
SHSTDAPI_(int) SHGetIconOverlayIndexW(LPCWSTR pszIconPath, int iIconIndex);
#ifdef UNICODE
#define SHGetIconOverlayIndex SHGetIconOverlayIndexW
#else
#define SHGetIconOverlayIndex SHGetIconOverlayIndexA
#endif // !UNICODE
//===========================================================================
//
// IShellLink Interface
//
//===========================================================================
#ifdef UNICODE
#define IShellLink IShellLinkW
#define IShellLinkVtbl IShellLinkWVtbl
#else
#define IShellLink IShellLinkA
#define IShellLinkVtbl IShellLinkAVtbl
#endif
// IShellLink::Resolve fFlags
typedef enum {
SLR_NO_UI = 0x0001, // don't post any UI durring the resolve operation
SLR_ANY_MATCH = 0x0002, // no longer used
SLR_UPDATE = 0x0004, // save the link back to it's file if the track made it dirty
SLR_NOUPDATE = 0x0008,
SLR_NOSEARCH = 0x0010, // don't execute the search heuristics
SLR_NOTRACK = 0x0020, // don't use NT5 object ID to track the link
SLR_NOLINKINFO = 0x0040, // don't use the net and volume relative info
SLR_INVOKE_MSI = 0x0080, // if we have a darwin link, then call msi to fault in the applicaion
} SLR_FLAGS;
// IShellLink::GetPath fFlags
typedef enum {
SLGP_SHORTPATH = 0x0001,
SLGP_UNCPRIORITY = 0x0002,
SLGP_RAWPATH = 0x0004,
} SLGP_FLAGS;
#undef INTERFACE
#define INTERFACE IShellLinkA
DECLARE_INTERFACE_(IShellLinkA, IUnknown) // sl
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IShellLink methods ***
STDMETHOD(GetPath)(THIS_ LPSTR pszFile, int cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags) PURE;
STDMETHOD(GetIDList)(THIS_ LPITEMIDLIST * ppidl) PURE;
STDMETHOD(SetIDList)(THIS_ LPCITEMIDLIST pidl) PURE;
STDMETHOD(GetDescription)(THIS_ LPSTR pszName, int cchMaxName) PURE;
STDMETHOD(SetDescription)(THIS_ LPCSTR pszName) PURE;
STDMETHOD(GetWorkingDirectory)(THIS_ LPSTR pszDir, int cchMaxPath) PURE;
STDMETHOD(SetWorkingDirectory)(THIS_ LPCSTR pszDir) PURE;
STDMETHOD(GetArguments)(THIS_ LPSTR pszArgs, int cchMaxPath) PURE;
STDMETHOD(SetArguments)(THIS_ LPCSTR pszArgs) PURE;
STDMETHOD(GetHotkey)(THIS_ WORD *pwHotkey) PURE;
STDMETHOD(SetHotkey)(THIS_ WORD wHotkey) PURE;
STDMETHOD(GetShowCmd)(THIS_ int *piShowCmd) PURE;
STDMETHOD(SetShowCmd)(THIS_ int iShowCmd) PURE;
STDMETHOD(GetIconLocation)(THIS_ LPSTR pszIconPath, int cchIconPath, int *piIcon) PURE;
STDMETHOD(SetIconLocation)(THIS_ LPCSTR pszIconPath, int iIcon) PURE;
STDMETHOD(SetRelativePath)(THIS_ LPCSTR pszPathRel, DWORD dwReserved) PURE;
STDMETHOD(Resolve)(THIS_ HWND hwnd, DWORD fFlags) PURE;
STDMETHOD(SetPath)(THIS_ LPCSTR pszFile) PURE;
};
#undef INTERFACE
#define INTERFACE IShellLinkW
DECLARE_INTERFACE_(IShellLinkW, IUnknown) // sl
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IShellLink methods ***
STDMETHOD(GetPath)(THIS_ LPWSTR pszFile, int cchMaxPath, WIN32_FIND_DATAW *pfd, DWORD fFlags) PURE;
STDMETHOD(GetIDList)(THIS_ LPITEMIDLIST * ppidl) PURE;
STDMETHOD(SetIDList)(THIS_ LPCITEMIDLIST pidl) PURE;
STDMETHOD(GetDescription)(THIS_ LPWSTR pszName, int cchMaxName) PURE;
STDMETHOD(SetDescription)(THIS_ LPCWSTR pszName) PURE;
STDMETHOD(GetWorkingDirectory)(THIS_ LPWSTR pszDir, int cchMaxPath) PURE;
STDMETHOD(SetWorkingDirectory)(THIS_ LPCWSTR pszDir) PURE;
STDMETHOD(GetArguments)(THIS_ LPWSTR pszArgs, int cchMaxPath) PURE;
STDMETHOD(SetArguments)(THIS_ LPCWSTR pszArgs) PURE;
STDMETHOD(GetHotkey)(THIS_ WORD *pwHotkey) PURE;
STDMETHOD(SetHotkey)(THIS_ WORD wHotkey) PURE;
STDMETHOD(GetShowCmd)(THIS_ int *piShowCmd) PURE;
STDMETHOD(SetShowCmd)(THIS_ int iShowCmd) PURE;
STDMETHOD(GetIconLocation)(THIS_ LPWSTR pszIconPath, int cchIconPath, int *piIcon) PURE;
STDMETHOD(SetIconLocation)(THIS_ LPCWSTR pszIconPath, int iIcon) PURE;
STDMETHOD(SetRelativePath)(THIS_ LPCWSTR pszPathRel, DWORD dwReserved) PURE;
STDMETHOD(Resolve)(THIS_ HWND hwnd, DWORD fFlags) PURE;
STDMETHOD(SetPath)(THIS_ LPCWSTR pszFile) PURE;
};
#if (_WIN32_IE >= 0x0400)
// IShellLinkDataList::GetFlags()/SetFlags()
typedef enum {
SLDF_HAS_ID_LIST = 0x00000001, // Shell link saved with ID list
SLDF_HAS_LINK_INFO = 0x00000002, // Shell link saved with LinkInfo
SLDF_HAS_NAME = 0x00000004,
SLDF_HAS_RELPATH = 0x00000008,
SLDF_HAS_WORKINGDIR = 0x00000010,
SLDF_HAS_ARGS = 0x00000020,
SLDF_HAS_ICONLOCATION = 0x00000040,
SLDF_UNICODE = 0x00000080, // the strings are unicode
SLDF_FORCE_NO_LINKINFO = 0x00000100, // don't create a LINKINFO (make a dumb link)
SLDF_HAS_EXP_SZ = 0x00000200, // the link contains expandable env strings
SLDF_RUN_IN_SEPARATE = 0x00000400, // Run the 16-bit target exe in a separate VDM/WOW
SLDF_HAS_LOGO3ID = 0x00000800, // this link is a special Logo3/MSICD link
SLDF_HAS_DARWINID = 0x00001000, // this link is a special Darwin link
SLDF_RUNAS_USER = 0x00002000, // Run this link as a different user
SLDF_HAS_EXP_ICON_SZ = 0x00004000 // contains expandable env string for icon path
} SHELL_LINK_DATA_FLAGS;
//
// We conditionally define it here to break the circular dependency between
// shlobj and shlwapi.
//
#ifndef __DATABLOCKHEADER_DEFINED
#define __DATABLOCKHEADER_DEFINED
typedef struct tagDATABLOCKHEADER
{
DWORD cbSize; // Size of this extra data block
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -