📄 shlobj.h
字号:
// ShowInitialize and Show. The filename is always given to the
// viewer through IPersistFile.
//
//===========================================================================
typedef struct
{
// Stuff passed into viewer (in)
DWORD cbSize; // Size of structure for future expansion...
HWND hwndOwner; // who is the owner window.
int iShow; // The show command
// Passed in and updated (in/Out)
DWORD dwFlags; // flags
RECT rect; // Where to create the window may have defaults
LPUNKNOWN punkRel; // Relese this interface when window is visible
// Stuff that might be returned from viewer (out)
OLECHAR strNewFile[MAX_PATH]; // New File to view.
} FVSHOWINFO, *LPFVSHOWINFO;
// Define File View Show Info Flags.
#define FVSIF_RECT 0x00000001 // The rect variable has valid data.
#define FVSIF_PINNED 0x00000002 // We should Initialize pinned
#define FVSIF_NEWFAILED 0x08000000 // The new file passed back failed
// to be viewed.
#define FVSIF_NEWFILE 0x80000000 // A new file to view has been returned
#define FVSIF_CANVIEWIT 0x40000000 // The viewer can view it.
#undef INTERFACE
#define INTERFACE IFileViewerA
DECLARE_INTERFACE(IFileViewerA)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IFileViewer methods ***
STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
STDMETHOD(PrintTo) (THIS_ LPSTR pszDriver, BOOL fSuppressUI) PURE;
};
typedef IFileViewerA * LPFILEVIEWERA;
#undef INTERFACE
#define INTERFACE IFileViewerW
DECLARE_INTERFACE(IFileViewerW)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IFileViewer methods ***
STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
STDMETHOD(PrintTo) (THIS_ LPWSTR pszDriver, BOOL fSuppressUI) PURE;
};
typedef IFileViewerW * LPFILEVIEWERW;
#ifdef UNICODE
#define IFileViewer IFileViewerW
#define LPFILEVIEWER LPFILEVIEWERW
#else
#define IFileViewer IFileViewerA
#define LPFILEVIEWER LPFILEVIEWERA
#endif
//==========================================================================
//
// IShellBrowser/IShellView/IShellFolder interface
//
// These three interfaces are used when the shell communicates with
// name space extensions. The shell (explorer) provides IShellBrowser
// interface, and extensions implements IShellFolder and IShellView
// interfaces.
//
//==========================================================================
//--------------------------------------------------------------------------
//
// Command/menuitem IDs
//
// The explorer dispatches WM_COMMAND messages based on the range of
// command/menuitem IDs. All the IDs of menuitems that the view (right
// pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer
// won't dispatch them). The view should not deal with any menuitems
// in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future
// version of the shell).
//
// FCIDM_SHVIEWFIRST/LAST for the right pane (IShellView)
// FCIDM_BROWSERFIRST/LAST for the explorer frame (IShellBrowser)
// FCIDM_GLOBAL/LAST for the explorer's submenu IDs
//
//--------------------------------------------------------------------------
#define FCIDM_SHVIEWFIRST 0x0000
#define FCIDM_SHVIEWLAST 0x7fff
#define FCIDM_BROWSERFIRST 0xa000
#define FCIDM_BROWSERLAST 0xbf00
#define FCIDM_GLOBALFIRST 0x8000
#define FCIDM_GLOBALLAST 0x9fff
//
// Global submenu IDs and separator IDs
//
#define FCIDM_MENU_FILE (FCIDM_GLOBALFIRST+0x0000)
#define FCIDM_MENU_EDIT (FCIDM_GLOBALFIRST+0x0040)
#define FCIDM_MENU_VIEW (FCIDM_GLOBALFIRST+0x0080)
#define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
#define FCIDM_MENU_TOOLS (FCIDM_GLOBALFIRST+0x00c0)
#define FCIDM_MENU_TOOLS_SEP_GOTO (FCIDM_GLOBALFIRST+0x00c1)
#define FCIDM_MENU_HELP (FCIDM_GLOBALFIRST+0x0100)
#define FCIDM_MENU_FIND (FCIDM_GLOBALFIRST+0x0140)
#define FCIDM_MENU_EXPLORE (FCIDM_GLOBALFIRST+0x0150)
#define FCIDM_MENU_FAVORITES (FCIDM_GLOBALFIRST+0x0170)
//--------------------------------------------------------------------------
// control IDs known to the view
//--------------------------------------------------------------------------
#define FCIDM_TOOLBAR (FCIDM_BROWSERFIRST + 0)
#define FCIDM_STATUS (FCIDM_BROWSERFIRST + 1)
#if (_WIN32_IE >= 0x0400)
//--------------------------------------------------------------------------
//
// The resource id of the offline cursor
// This cursor is avaialble in shdocvw.dll
#define IDC_OFFLINE_HAND 103
//
//--------------------------------------------------------------------------
#endif
//--------------------------------------------------------------------------
//
// FOLDERSETTINGS
//
// FOLDERSETTINGS is a data structure that explorer passes from one folder
// view to another, when the user is browsing. It calls ISV::GetCurrentInfo
// member to get the current settings and pass it to ISV::CreateViewWindow
// to allow the next folder view "inherit" it. These settings assumes a
// particular UI (which the shell's folder view has), and shell extensions
// may or may not use those settings.
//
//--------------------------------------------------------------------------
typedef LPBYTE LPVIEWSETTINGS;
// NB Bitfields.
// FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL
typedef enum
{
FWF_AUTOARRANGE = 0x0001,
FWF_ABBREVIATEDNAMES = 0x0002,
FWF_SNAPTOGRID = 0x0004,
FWF_OWNERDATA = 0x0008,
FWF_BESTFITWINDOW = 0x0010,
FWF_DESKTOP = 0x0020,
FWF_SINGLESEL = 0x0040,
FWF_NOSUBFOLDERS = 0x0080,
FWF_TRANSPARENT = 0x0100,
FWF_NOCLIENTEDGE = 0x0200,
FWF_NOSCROLL = 0x0400,
FWF_ALIGNLEFT = 0x0800,
FWF_NOICONS = 0x1000,
FWF_SINGLECLICKACTIVATE=0x8000 // TEMPORARY -- NO UI FOR THIS
} FOLDERFLAGS;
typedef enum
{
FVM_ICON = 1,
FVM_SMALLICON = 2,
FVM_LIST = 3,
FVM_DETAILS = 4,
} FOLDERVIEWMODE;
typedef struct
{
UINT ViewMode; // View mode (FOLDERVIEWMODE values)
UINT fFlags; // View options (FOLDERFLAGS bits)
} FOLDERSETTINGS, *LPFOLDERSETTINGS;
typedef const FOLDERSETTINGS * LPCFOLDERSETTINGS;
//--------------------------------------------------------------------------
//
// Interface: IShellBrowser
//
// IShellBrowser interface is the interface that is provided by the shell
// explorer/folder frame window. When it creates the "contents pane" of
// a shell folder (which provides IShellFolder interface), it calls its
// CreateViewObject member function to create an IShellView object. Then,
// it calls its CreateViewWindow member to create the "contents pane"
// window. The pointer to the IShellBrowser interface is passed to
// the IShellView object as a parameter to this CreateViewWindow member
// function call.
//
// +--------------------------+ <-- Explorer window
// | [] Explorer |
// |--------------------------+ IShellBrowser
// | File Edit View .. |
// |--------------------------|
// | | |
// | | <-------- Content pane
// | | |
// | | | IShellView
// | | |
// | | |
// +--------------------------+
//
//
//
// [Member functions]
//
//
// IShellBrowser::GetWindow(phwnd)
//
// 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)
// SBSP_NAVIGATEBACK -- Navigate back (ignores the pidl)
// SBSP_NAVIGATEFORWARD -- Navigate forward (ignores the pidl)
//
// Following two flags control history manipulation as result of navigate
// SBSP_WRITENOHISTORY -- write no history (shell folder) entry
// SBSP_NOAUTOSELECT -- suppress selection in history pane
//
// 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::Insert
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -