📄 shlobj.h
字号:
#endif
#define CMDSTR_NEWFOLDERA "NewFolder"
#define CMDSTR_VIEWLISTA "ViewList"
#define CMDSTR_VIEWDETAILSA "ViewDetails"
#define CMDSTR_NEWFOLDERW L"NewFolder"
#define CMDSTR_VIEWLISTW L"ViewList"
#define CMDSTR_VIEWDETAILSW L"ViewDetails"
#ifdef UNICODE
#define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERW
#define CMDSTR_VIEWLIST CMDSTR_VIEWLISTW
#define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSW
#else
#define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA
#define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA
#define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA
#endif
#define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY
#define CMIC_MASK_ICON SEE_MASK_ICON
#define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI
#define CMIC_MASK_UNICODE SEE_MASK_UNICODE
#define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE
#define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME
#define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM
#define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE
#define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK
#if (_WIN32_IE >= 0x0501)
#define CMIC_MASK_SHIFT_DOWN 0x10000000
#define CMIC_MASK_CONTROL_DOWN 0x20000000
#endif // (_WIN32_IE >= 0x501)
#if (_WIN32_IE >= 0x0400)
#define CMIC_MASK_PTINVOKE 0x20000000
#endif
//NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor
typedef struct _CMINVOKECOMMANDINFO {
DWORD cbSize; // sizeof(CMINVOKECOMMANDINFO)
DWORD fMask; // any combination of CMIC_MASK_*
HWND hwnd; // might be NULL (indicating no owner window)
LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)
LPCSTR lpParameters; // might be NULL (indicating no parameter)
LPCSTR lpDirectory; // might be NULL (indicating no specific directory)
int nShow; // one of SW_ values for ShowWindow() API
DWORD dwHotKey;
HANDLE hIcon;
} CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO;
typedef struct _CMInvokeCommandInfoEx {
DWORD cbSize; // must be sizeof(CMINVOKECOMMANDINFOEX)
DWORD fMask; // any combination of CMIC_MASK_*
HWND hwnd; // might be NULL (indicating no owner window)
LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)
LPCSTR lpParameters; // might be NULL (indicating no parameter)
LPCSTR lpDirectory; // might be NULL (indicating no specific directory)
int nShow; // one of SW_ values for ShowWindow() API
DWORD dwHotKey;
HANDLE hIcon;
LPCSTR lpTitle; // For CreateProcess-StartupInfo.lpTitle
LPCWSTR lpVerbW; // Unicode verb (for those who can use it)
LPCWSTR lpParametersW; // Unicode parameters (for those who can use it)
LPCWSTR lpDirectoryW; // Unicode directory (for those who can use it)
LPCWSTR lpTitleW; // Unicode title (for those who can use it)
#if (_WIN32_IE >= 0x0400)
POINT ptInvoke; // Point where it's invoked
#endif
} CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX;
#undef INTERFACE
#define INTERFACE IContextMenu
DECLARE_INTERFACE_(IContextMenu, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
STDMETHOD(QueryContextMenu)(THIS_
HMENU hmenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags) PURE;
STDMETHOD(InvokeCommand)(THIS_
LPCMINVOKECOMMANDINFO lpici) PURE;
STDMETHOD(GetCommandString)(THIS_
UINT_PTR idCmd,
UINT uType,
UINT * pwReserved,
LPSTR pszName,
UINT cchMax) PURE;
};
typedef IContextMenu * LPCONTEXTMENU;
//
// IContextMenu2 (IContextMenu with one new member)
//
// IContextMenu2::HandleMenuMsg
//
// This function is called, if the client of IContextMenu is aware of
// IContextMenu2 interface and receives one of following messages while
// it is calling TrackPopupMenu (in the window proc of hwnd):
// WM_INITPOPUP, WM_DRAWITEM and WM_MEASUREITEM
// The callee may handle these messages to draw owner draw menuitems.
//
#undef INTERFACE
#define INTERFACE IContextMenu2
DECLARE_INTERFACE_(IContextMenu2, IContextMenu)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IContextMenu methods ***
STDMETHOD(QueryContextMenu)(THIS_
HMENU hmenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags) PURE;
STDMETHOD(InvokeCommand)(THIS_
LPCMINVOKECOMMANDINFO lpici) PURE;
STDMETHOD(GetCommandString)(THIS_
UINT_PTR idCmd,
UINT uType,
UINT * pwReserved,
LPSTR pszName,
UINT cchMax) PURE;
// *** IContextMenu2 methods ***
STDMETHOD(HandleMenuMsg)(THIS_
UINT uMsg,
WPARAM wParam,
LPARAM lParam) PURE;
};
typedef IContextMenu2 * LPCONTEXTMENU2;
//
// IContextMenu3 (IContextMenu with one new member)
//
// IContextMenu3::HandleMenuMsg2
//
// This function is called, if the client of IContextMenu is aware of
// IContextMenu3 interface and receives a menu message while
// it is calling TrackPopupMenu (in the window proc of hwnd):
//
#undef INTERFACE
#define INTERFACE IContextMenu3
DECLARE_INTERFACE_(IContextMenu3, IContextMenu2)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IContextMenu methods ***
STDMETHOD(QueryContextMenu)(THIS_
HMENU hmenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags) PURE;
STDMETHOD(InvokeCommand)(THIS_
LPCMINVOKECOMMANDINFO lpici) PURE;
STDMETHOD(GetCommandString)(THIS_
UINT_PTR idCmd,
UINT uType,
UINT * pwReserved,
LPSTR pszName,
UINT cchMax) PURE;
// *** IContextMenu2 methods ***
STDMETHOD(HandleMenuMsg)(THIS_
UINT uMsg,
WPARAM wParam,
LPARAM lParam) PURE;
// *** IContextMenu3 methods ***
STDMETHOD(HandleMenuMsg2)(THIS_
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT* plResult) PURE;
};
typedef IContextMenu3 * LPCONTEXTMENU3;
//===========================================================================
//
// Interface: IShellExtInit
//
// The IShellExtInit interface is used by the explorer to initialize shell
// extension objects. The explorer (1) calls CoCreateInstance (or equivalent)
// with the registered CLSID and IID_IShellExtInit, (2) calls its Initialize
// member, then (3) calls its QueryInterface to a particular interface (such
// as IContextMenu or IPropSheetExt and (4) performs the rest of operation.
//
//
// [Member functions]
//
// IShellExtInit::Initialize
//
// This member function is called when the explorer is initializing either
// context menu extension, property sheet extension or non-default drag-drop
// extension.
//
// Parameters: (context menu or property sheet extension)
// pidlFolder -- Specifies the parent folder
// lpdobj -- Spefifies the set of items selected in that folder.
// hkeyProgID -- Specifies the type of the focused item in the selection.
//
// Parameters: (non-default drag-and-drop extension)
// pidlFolder -- Specifies the target (destination) folder
// lpdobj -- Specifies the items that are dropped (see the description
// about shell's clipboard below for clipboard formats).
// hkeyProgID -- Specifies the folder type.
//
//===========================================================================
#undef INTERFACE
#define INTERFACE IShellExtInit
DECLARE_INTERFACE_(IShellExtInit, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IShellExtInit methods ***
STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidlFolder,
IDataObject *lpdobj, HKEY hkeyProgID) PURE;
};
typedef IShellExtInit * LPSHELLEXTINIT;
//===========================================================================
//
// Interface: IShellPropSheetExt
//
// The explorer uses the IShellPropSheetExt to allow property sheet
// extensions or control panel extensions to add additional property
// sheet pages.
//
//
// [Member functions]
//
// IShellPropSheetExt::AddPages
//
// The explorer calls this member function when it finds a registered
// property sheet extension for a particular type of object. For each
// additional page, the extension creates a page object by calling
// CreatePropertySheetPage API and calls lpfnAddPage.
//
// Parameters:
// lpfnAddPage -- Specifies the callback function.
// lParam -- Specifies the opaque handle to be passed to the callback function.
//
//
// IShellPropSheetExt::ReplacePage
//
// The explorer never calls this member of property sheet extensions. The
// explorer calls this member of control panel extensions, so that they
// can replace some of default control panel pages (such as a page of
// mouse control panel).
//
// Parameters:
// uPageID -- Specifies the page to be replaced.
// lpfnReplace Specifies the callback function.
// lParam -- Specifies the opaque handle to be passed to the callback function.
//
//===========================================================================
#undef INTERFACE
#define INTERFACE IShellPropSheetExt
DECLARE_INTERFACE_(IShellPropSheetExt, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IShellPropSheetExt methods ***
STDMETHOD(AddPages)(THIS_ LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam) PURE;
STDMETHOD(ReplacePage)(THIS_ UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam) PURE;
};
typedef IShellPropSheetExt * LPSHELLPROPSHEETEXT;
//===========================================================================
//
// IPersistFolder Interface
//
// The IPersistFolder interface is used by the file system implementation of
// IShellFolder::BindToObject when it is initializing a shell folder object.
//
//
// [Member functions]
//
// IPersistFolder::Initialize
//
// This member function is called when the explorer is initializing a
// shell folder object.
//
// Parameters:
// pidl -- Specifies the absolute location of the folder.
//
//===========================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -