📄 shlobj.h
字号:
// 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
#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
SLDF_NO_PIDL_ALIAS = 0x00008000, // don't ever resolve to a logical location
SLDF_FORCE_UNCNAME = 0x00010000, // make GetPath() prefer the UNC name to the local name
SLDF_RUN_WITH_SHIMLAYER = 0x00020000, // Launch the target of this link w/ shim layer active
SLDF_RESERVED = 0x80000000, // Reserved-- so we can use the low word as an index value in the future
} SHELL_LINK_DATA_FLAGS;
typedef struct tagDATABLOCKHEADER
{
DWORD cbSize; // Size of this extra data block
DWORD dwSignature; // signature of this extra data block
} DATABLOCK_HEADER, *LPDATABLOCK_HEADER, *LPDBLIST;
typedef struct {
#ifdef __cplusplus
DATABLOCK_HEADER dbh;
#else
DATABLOCK_HEADER;
#endif
WORD wFillAttribute; // fill attribute for console
WORD wPopupFillAttribute; // fill attribute for console popups
COORD dwScreenBufferSize; // screen buffer size for console
COORD dwWindowSize; // window size for console
COORD dwWindowOrigin; // window origin for console
DWORD nFont;
DWORD nInputBufferSize;
COORD dwFontSize;
UINT uFontFamily;
UINT uFontWeight;
WCHAR FaceName[LF_FACESIZE];
UINT uCursorSize;
BOOL bFullScreen;
BOOL bQuickEdit;
BOOL bInsertMode;
BOOL bAutoPosition;
UINT uHistoryBufferSize;
UINT uNumberOfHistoryBuffers;
BOOL bHistoryNoDup;
COLORREF ColorTable[ 16 ];
} NT_CONSOLE_PROPS, *LPNT_CONSOLE_PROPS;
#define NT_CONSOLE_PROPS_SIG 0xA0000002
// This is a FE Console property
typedef struct {
#ifdef __cplusplus
DATABLOCK_HEADER dbh;
#else
DATABLOCK_HEADER;
#endif
UINT uCodePage;
} NT_FE_CONSOLE_PROPS, *LPNT_FE_CONSOLE_PROPS;
#define NT_FE_CONSOLE_PROPS_SIG 0xA0000004
#if (_WIN32_IE >= 0x0500)
typedef struct {
#ifdef __cplusplus
DATABLOCK_HEADER dbh;
#else
DATABLOCK_HEADER;
#endif
CHAR szDarwinID[MAX_PATH]; // ANSI darwin ID associated with link
WCHAR szwDarwinID[MAX_PATH]; // UNICODE darwin ID associated with link
} EXP_DARWIN_LINK, *LPEXP_DARWIN_LINK;
#define EXP_DARWIN_ID_SIG 0xA0000006
#define EXP_LOGO3_ID_SIG 0xA0000007
#endif
#define EXP_SPECIAL_FOLDER_SIG 0xA0000005 // LPEXP_SPECIAL_FOLDER
typedef struct
{
DWORD cbSize; // Size of this extra data block
DWORD dwSignature; // signature of this extra data block
DWORD idSpecialFolder; // special folder id this link points into
DWORD cbOffset; // ofset into pidl from SLDF_HAS_ID_LIST for child
} EXP_SPECIAL_FOLDER, *LPEXP_SPECIAL_FOLDER;
typedef struct
{
DWORD cbSize; // Size of this extra data block
DWORD dwSignature; // signature of this extra data block
CHAR szTarget[ MAX_PATH ]; // ANSI target name w/EXP_SZ in it
WCHAR swzTarget[ MAX_PATH ]; // UNICODE target name w/EXP_SZ in it
} EXP_SZ_LINK, *LPEXP_SZ_LINK;
#define EXP_SZ_LINK_SIG 0xA0000001 // LPEXP_SZ_LINK (target)
#define EXP_SZ_ICON_SIG 0xA0000007 // LPEXP_SZ_LINK (icon)
#undef INTERFACE
#define INTERFACE IShellLinkDataList
DECLARE_INTERFACE_(IShellLinkDataList, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// *** IShellLinkDataList methods ***
STDMETHOD(AddDataBlock)(THIS_ void * pDataBlock) PURE;
STDMETHOD(CopyDataBlock)(THIS_ DWORD dwSig, void **ppDataBlock) PURE;
STDMETHOD(RemoveDataBlock)(THIS_ DWORD dwSig) PURE;
STDMETHOD(GetFlags)(THIS_ DWORD *pdwFlags) PURE;
STDMETHOD(SetFlags)(THIS_ DWORD dwFlags) PURE;
};
#endif // (_WIN32_IE >= 0x0400)
#if (_WIN32_IE >= 0x0500)
#undef INTERFACE
#define INTERFACE IResolveShellLink
DECLARE_INTERFACE_(IResolveShellLink, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// *** IResolveShellLink methods ***
STDMETHOD(ResolveShellLink)(THIS_ IUnknown* punk, HWND hwnd, DWORD fFlags) PURE;
};
#endif // (_WIN32_IE >= 0x0500)
#ifdef _INC_SHELLAPI /* for LPSHELLEXECUTEINFO */
//===========================================================================
//
// IShellExecuteHook Interface
//
//===========================================================================
#undef INTERFACE
#define INTERFACE IShellExecuteHookA
DECLARE_INTERFACE_(IShellExecuteHookA, IUnknown) // shexhk
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// *** IShellExecuteHookA methods ***
STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOA pei) PURE;
};
#undef INTERFACE
#define INTERFACE IShellExecuteHookW
DECLARE_INTERFACE_(IShellExecuteHookW, IUnknown) // shexhk
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// *** IShellExecuteHookW methods ***
STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOW pei) PURE;
};
#ifdef UNICODE
#define IShellExecuteHook IShellExecuteHookW
#define IShellExecuteHookVtbl IShellExecuteHookWVtbl
#else
#define IShellExecuteHook IShellExecuteHookA
#define IShellExecuteHookVtbl IShellExecuteHookAVtbl
#endif
#endif
//===========================================================================
//
// IURLSearchHook Interface
//
//===========================================================================
#undef INTERFACE
#define INTERFACE IURLSearchHook
DECLARE_INTERFACE_(IURLSearchHook, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// *** IURLSearchHook methods ***
STDMETHOD(Translate)(THIS_ LPWSTR lpwszSearchURL, DWORD cchBufferSize) PURE;
};
#undef INTERFACE
#define INTERFACE ISearchContext
DECLARE_INTERFACE_(ISearchContext, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// *** ISearchContext methods ***
STDMETHOD(GetSearchUrl)(THIS_ BSTR * pbstrSearchUrl) PURE;
STDMETHOD(GetSearchText)(THIS_ BSTR * pbstrSearchText) PURE;
STDMETHOD(GetSearchStyle)(THIS_ DWORD * pdwSearchStyle) PURE;
};
#undef INTERFACE
#define INTERFACE IURLSearchHook2
DECLARE_INTERFACE_(IURLSearchHook2, IURLSearchHook)
{
// *** IURLSearchHook2 methods ***
STDMETHOD(TranslateWithSearchContext)(THIS_ LPWSTR lpwszSearchURL, DWORD cchBufferSize, ISearchContext * pSearchContext) PURE;
};
//===========================================================================
//
// INewShortcutHook Interface
//
//===========================================================================
#undef INTERFACE
#define INTERFACE INewShortcutHookA
DECLARE_INTERFACE_(INewShortcutHookA, IUnknown) // nshhk
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// *** INewShortcutHook methods ***
STDMETHOD(SetReferent)(THIS_ LPCSTR pcszReferent, HWND hwnd) PURE;
STDMETHOD(GetReferent)(THIS_ LPSTR pszReferent, int cchReferent) PURE;
STDMETHOD(SetFolder)(THIS_ LPCSTR pcszFolder) PURE;
STDMETHOD(GetFolder)(THIS_ LPSTR pszFolder, int cchFolder) PURE;
STDMETHOD(GetName)(THIS_ LPSTR pszName, int cchName) PURE;
STDMETHOD(GetExtension)(THIS_ LPSTR pszExtension, int cchExtension) PURE;
};
#undef INTERFACE
#define INTERFACE INewShortcutHookW
DECLARE_INTERFACE_(INewShortcutHookW, IUnknown) // nshhk
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// *** INewShortcutHook methods ***
STDMETHOD(SetReferent)(THIS_ LPCWSTR pcszReferent, HWND hwnd) PURE;
STDMETHOD(GetReferent)(THIS_ LPWSTR pszReferent, int cchReferent) PURE;
STDMETHOD(SetFolder)(THIS_ LPCWSTR pcszFolder) PURE;
STDMETHOD(GetFolder)(THIS_ LPWSTR pszFolder, int cchFolder) PURE;
STDMETHOD(GetName)(THIS_ LPWSTR pszName, int cchName) PURE;
STDMETHOD(GetExtension)(THIS_ LPWSTR pszExtension, int cchExtension) PURE;
};
#ifdef UNICODE
#define INewShortcutHook INewShortcutHookW
#define INewShortcutHookVtbl INewShortcutHookWVtbl
#else
#define INewShortcutHook INewShortcutHookA
#define INewShortcutHookVtbl INewShortcutHookAVtbl
#endif
//===========================================================================
//
// ICopyHook Interface
//
// The copy hook is called whenever file system directories are
// copy/moved/deleted/renamed via the shell. It is also called by the shell
// on changes of status of printers.
//
// Clients register their id under STRREG_SHEX_COPYHOOK for file system hooks
// and STRREG_SHEx_PRNCOPYHOOK for printer hooks.
// the CopyCallback is called prior to the action, so the hook has the chance
// to allow, deny or cancel the operation by returning the falues:
// IDYES - means allow the operation
// IDNO - means disallow the operation on this file, but continue with
// any other operations (eg. batch copy)
// IDCANCEL - means disallow the current operation and cancel any pending
// operations
//
// arguments to the CopyCallback
// hwnd - window to use for any UI
// wFunc - what operation is being done
// wFlags - and flags (FOF_*) set in the initial call to the file operation
// pszSrcFile - name of the source file
// dwSrcAttribs - file attributes of the source file
// pszDestFile - name of the destiation file (for move and renames)
// dwDestAttribs - file attributes of the destination file
//
//
//===========================================================================
#ifndef FO_MOVE //these need to be kept in sync with the ones in shellapi.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -