📄 shlobj.h
字号:
//
// Inherited from IOleWindow::GetWindow.
//
//
// IShellBrowser::ContextSensitiveHelp(fEnterMode)
//
// Inherited from IOleWindow::ContextSensitiveHelp.
//
//
// IShellBrowser::InsertMenusSB(hmenuShared, lpMenuWidths)
//
// Similar to the IOleInPlaceFrame::InsertMenus. The explorer will put
// "File" and "Edit" pulldown in the File menu group, "View" and "Tools"
// in the Container menu group and "Help" in the Window menu group. Each
// pulldown menu will have a uniqu ID, FCIDM_MENU_FILE/EDIT/VIEW/TOOLS/HELP.
// The view is allowed to insert menuitems into those sub-menus by those
// IDs must be between FCIDM_SHVIEWFIRST and FCIDM_SHVIEWLAST.
//
//
// IShellBrowser::SetMenuSB(hmenuShared, holemenu, hwndActiveObject)
//
// Similar to the IOleInPlaceFrame::SetMenu. The explorer ignores the
// holemenu parameter (reserved for future enhancement) and performs
// menu-dispatch based on the menuitem IDs (see the description above).
// It is important to note that the explorer will add different
// set of menuitems depending on whether the view has a focus or not.
// Therefore, it is very important to call ISB::OnViewWindowActivate
// whenever the view window (or its children) gets the focus.
//
//
// IShellBrowser::RemoveMenusSB(hmenuShared)
//
// Same as the IOleInPlaceFrame::RemoveMenus.
//
//
// IShellBrowser::SetStatusTextSB(lpszStatusText)
//
// Same as the IOleInPlaceFrame::SetStatusText. It is also possible to
// send messages directly to the status window via SendControlMsg.
//
//
// IShellBrowser::EnableModelessSB(fEnable)
//
// Same as the IOleInPlaceFrame::EnableModeless.
//
//
// IShellBrowser::TranslateAcceleratorSB(lpmsg, wID)
//
// Same as the IOleInPlaceFrame::TranslateAccelerator, but will be
// never called because we don't support EXEs (i.e., the explorer has
// the message loop). This member function is defined here for possible
// future enhancement.
//
//
// IShellBrowser::BrowseObject(pidl, wFlags)
//
// The view calls this member to let shell explorer browse to another
// folder. The pidl and wFlags specifies the folder to be browsed.
//
// Following three flags specifies whether it creates another window or not.
// SBSP_SAMEBROWSER -- Browse to another folder with the same window.
// SBSP_NEWBROWSER -- Creates another window for the specified folder.
// SBSP_DEFBROWSER -- Default behavior (respects the view option).
//
// Following three flags specifies open, explore, or default mode. These .
// are ignored if SBSP_SAMEBROWSER or (SBSP_DEFBROWSER && (single window .
// browser || explorer)). .
// SBSP_OPENMODE -- Use a normal folder window
// SBSP_EXPLOREMODE -- Use an explorer window
// SBSP_DEFMODE -- Use the same as the current window
//
// Following three flags specifies the pidl.
// SBSP_ABSOLUTE -- pidl is an absolute pidl (relative from desktop)
// SBSP_RELATIVE -- pidl is relative from the current folder.
// SBSP_PARENT -- Browse the parent folder (ignores the pidl)
//
//
// IShellBrowser::GetViewStateStream(grfMode, ppstm)
//
// The browser returns an IStream interface as the storage for view
// specific state information.
//
// grfMode -- Specifies the read/write access (STGM_READ/WRITE/READWRITE)
// ppstm -- Specifies the LPSTREAM variable to be filled.
//
//
// IShellBrowser::GetControlWindow(id, phwnd)
//
// The shell view may call this member function to get the window handle
// of Explorer controls (toolbar or status winodw -- FCW_TOOLBAR or
// FCW_STATUS).
//
//
// IShellBrowser::SendControlMsg(id, uMsg, wParam, lParam, pret)
//
// The shell view calls this member function to send control messages to
// one of Explorer controls (toolbar or status window -- FCW_TOOLBAR or
// FCW_STATUS).
//
//
// IShellBrowser::QueryActiveShellView(IShellView * ppshv)
//
// This member returns currently activated (displayed) shellview object.
// A shellview never need to call this member function.
//
//
// IShellBrowser::OnViewWindowActive(pshv)
//
// The shell view window calls this member function when the view window
// (or one of its children) got the focus. It MUST call this member before
// calling IShellBrowser::InsertMenus, because it will insert different
// set of menu items depending on whether the view has the focus or not.
//
//
// IShellBrowser::SetToolbarItems(lpButtons, nButtons, uFlags)
//
// The view calls this function to add toolbar items to the exporer's
// toolbar. "lpButtons" and "nButtons" specifies the array of toolbar
// items. "uFlags" must be one of FCT_MERGE, FCT_CONFIGABLE, FCT_ADDTOEND.
//
//-------------------------------------------------------------------------
#undef INTERFACE
#define INTERFACE IShellBrowser
//
// Values for wFlags parameter of ISB::BrowseObject() member.
//
#define SBSP_DEFBROWSER 0x0000
#define SBSP_SAMEBROWSER 0x0001
#define SBSP_NEWBROWSER 0x0002
#define SBSP_DEFMODE 0x0000
#define SBSP_OPENMODE 0x0010
#define SBSP_EXPLOREMODE 0x0020
#define SBSP_ABSOLUTE 0x0000
#define SBSP_RELATIVE 0x1000
#define SBSP_PARENT 0x2000
#define SBSP_INITIATEDBYHLINKFRAME 0x80000000
#define SBSP_REDIRECT 0x40000000
//
// Values for id parameter of ISB::GetWindow/SendControlMsg members.
//
// WARNING:
// Any shell extensions which sends messages to those control windows
// might not work in the future version of windows. If you really need
// to send messages to them, (1) don't assume that those control window
// always exist (i.e. GetControlWindow may fail) and (2) verify the window
// class of the window before sending any messages.
//
#define FCW_STATUS 0x0001
#define FCW_TOOLBAR 0x0002
#define FCW_TREE 0x0003
//
// Values for uFlags paremeter of ISB::SetToolbarItems member.
//
#define FCT_MERGE 0x0001
#define FCT_CONFIGABLE 0x0002
#define FCT_ADDTOEND 0x0004
DECLARE_INTERFACE_(IShellBrowser, IOleWindow)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IOleWindow methods ***
STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
// *** IShellBrowser methods *** (same as IOleInPlaceFrame)
STDMETHOD(InsertMenusSB) (THIS_ HMENU hmenuShared,
LPOLEMENUGROUPWIDTHS lpMenuWidths) PURE;
STDMETHOD(SetMenuSB) (THIS_ HMENU hmenuShared, HOLEMENU holemenuReserved,
HWND hwndActiveObject) PURE;
STDMETHOD(RemoveMenusSB) (THIS_ HMENU hmenuShared) PURE;
STDMETHOD(SetStatusTextSB) (THIS_ LPCOLESTR lpszStatusText) PURE;
STDMETHOD(EnableModelessSB) (THIS_ BOOL fEnable) PURE;
STDMETHOD(TranslateAcceleratorSB) (THIS_ LPMSG lpmsg, WORD wID) PURE;
// *** IShellBrowser methods ***
STDMETHOD(BrowseObject)(THIS_ LPCITEMIDLIST pidl, UINT wFlags) PURE;
STDMETHOD(GetViewStateStream)(THIS_ DWORD grfMode,
LPSTREAM *ppStrm) PURE;
STDMETHOD(GetControlWindow)(THIS_ UINT id, HWND * lphwnd) PURE;
STDMETHOD(SendControlMsg)(THIS_ UINT id, UINT uMsg, WPARAM wParam,
LPARAM lParam, LRESULT * pret) PURE;
STDMETHOD(QueryActiveShellView)(THIS_ struct IShellView ** ppshv) PURE;
STDMETHOD(OnViewWindowActive)(THIS_ struct IShellView * ppshv) PURE;
STDMETHOD(SetToolbarItems)(THIS_ LPTBBUTTON lpButtons, UINT nButtons,
UINT uFlags) PURE;
};
typedef IShellBrowser * LPSHELLBROWSER;
enum {
SBSC_HIDE = 0,
SBSC_SHOW = 1,
SBSC_TOGGLE = 2,
SBSC_QUERY = 3
};
// CommandTarget ids.
enum {
SBCMDID_ENABLESHOWTREE,
SBCMDID_SHOWCONTROL, // variant vt_i4 = loword = FCW_* hiword = SBSC_*
SBCMDID_CANCELNAVIGATION, // cancel last navigation
SBCMDID_MAYSAVECHANGES, // about to close and may save changes
SBCMDID_SETHLINKFRAME, // variant vt_i4 = phlinkframe
SBCMDID_ENABLESTOP, // variant vt_bool = fEnable
SBCMDID_OPTIONS, // the view.options page
};
//-------------------------------------------------------------------------
// ICommDlgBrowser interface
//
// ICommDlgBrowser interface is the interface that is provided by the new
// common dialog window to hook and modify the behavior of IShellView. When
// a default view is created, it queries its parent IShellBrowser for the
// ICommDlgBrowser interface. If supported, it calls out to that interface
// in several cases that need to behave differently in a dialog.
//
// Member functions:
//
// ICommDlgBrowser::OnDefaultCommand()
// Called when the user double-clicks in the view or presses Enter. The
// browser should return S_OK if it processed the action itself, S_FALSE
// to let the view perform the default action.
//
// ICommDlgBrowser::OnStateChange(ULONG uChange)
// Called when some states in the view change. 'uChange' is one of the
// CDBOSC_* values. This call is made after the state (selection, focus,
// etc) has changed. There is no return value.
//
// ICommDlgBrowser::IncludeObject(LPCITEMIDLIST pidl)
// Called when the view is enumerating objects. 'pidl' is a relative
// IDLIST. The browser should return S_OK to include the object in the
// view, S_FALSE to hide it
//
//-------------------------------------------------------------------------
#undef INTERFACE
#define INTERFACE ICommDlgBrowser
#define CDBOSC_SETFOCUS 0x00000000
#define CDBOSC_KILLFOCUS 0x00000001
#define CDBOSC_SELCHANGE 0x00000002
#define CDBOSC_RENAME 0x00000003
DECLARE_INTERFACE_(ICommDlgBrowser, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** ICommDlgBrowser methods ***
STDMETHOD(OnDefaultCommand) (THIS_ struct IShellView * ppshv) PURE;
STDMETHOD(OnStateChange) (THIS_ struct IShellView * ppshv,
ULONG uChange) PURE;
STDMETHOD(IncludeObject) (THIS_ struct IShellView * ppshv,
LPCITEMIDLIST pidl) PURE;
};
typedef ICommDlgBrowser * LPCOMMDLGBROWSER;
//==========================================================================
//
// Interface: IShellView
//
// IShellView::GetWindow(phwnd)
//
// Inherited from IOleWindow::GetWindow.
//
//
// IShellView::ContextSensitiveHelp(fEnterMode)
//
// Inherited from IOleWindow::ContextSensitiveHelp.
//
//
// IShellView::TranslateAccelerator(lpmsg)
//
// Similar to IOleInPlaceActiveObject::TranlateAccelerator. The explorer
// calls this function BEFORE any other translation. Returning S_OK
// indicates that the message was translated (eaten) and should not be
// translated or dispatched by the explorer.
//
//
// IShellView::EnableModeless(fEnable)
// Similar to IOleInPlaceActiveObject::EnableModeless.
//
//
// IShellView::UIActivate(uState)
//
// The explorer calls this member function whenever the activation
// state of the view window is changed by a certain event that is
// NOT caused by the shell view itself.
//
// SVUIA_DEACTIVATE will be passed when the explorer is about to
// destroy the shell view window; the shell view is supposed to remove
// all the extended UIs (typically merged menu and modeless popup windows).
//
// SVUIA_ACTIVATE_NOFOCUS will be passsed when the shell view is losing
// the input focus or the shell view has been just created without the
// input focus; the shell view is supposed to set menuitems appropriate
// for non-focused state (no selection specific items should be added).
//
// SVUIA_ACTIVATE_FOCUS will be passed when the explorer has just
// created the view window with the input focus; the shell view is
// supposed to set menuitems appropriate for focused state.
//
// SVUIA_INPLACEACTIVATE(new) will be passed when the shell view is opened
// within an ActiveX control, which is not a UI active. In this case,
// the shell view should not merge menus or put toolbas. To be compatible
// with Win95 client, we don't pass this value unless the view supports
// IShellView2.
//
// The shell view should not change focus within this member function.
// The shell view should not hook the WM_KILLFOCUS message to remerge
// menuitems. However, the shell view typically hook the WM_SETFOCUS
// message, and re-merge the menu after calling IShellBrowser::
// OnViewWindowActivated.
//
//
// IShellView::Refresh()
//
// The explorer calls this member when the view needs to refresh its
// contents (such as when the user hits F5 key).
//
//
// IShellView::CreateViewWindow
//
// This member creates the view window
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -