2 * Copyright 2003 Martin Fuchs
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 // Martin Fuchs, 23.07.2003
27 // Credits: Thanks to Leon Finker for his explorer cabinet window example
31 #include "servprov.h" // for IServiceProvider
32 #include "docobj.h" // for IOleCommandTarget
36 /// Implementation of IShellBrowser and ICommDlgBrowser interfaces for explorer child windows (see ShellBrowserChild)
37 struct IShellBrowserImpl
38 : public IShellBrowser
,
39 public ICommDlgBrowser
,
40 public IServiceProvider
,
41 public IOleCommandTarget
48 virtual ~IShellBrowserImpl()
52 virtual HRESULT STDMETHODCALLTYPE
QueryInterface(REFIID iid
, void** ppvObject
);
54 virtual ULONG STDMETHODCALLTYPE
AddRef() {return ++_dwRef
;}
55 virtual ULONG STDMETHODCALLTYPE
Release() {return --_dwRef
;} //not heap based
57 // *** IOleWindow methods ***
58 virtual HRESULT STDMETHODCALLTYPE
ContextSensitiveHelp(BOOL fEnterMode
) {return E_NOTIMPL
;}
60 // *** ICommDlgBrowser methods ***
61 virtual HRESULT STDMETHODCALLTYPE
OnDefaultCommand(IShellView
* ppshv
);
63 virtual HRESULT STDMETHODCALLTYPE
OnStateChange(IShellView
* ppshv
, ULONG uChange
)
64 { //handle selection, rename, focus if needed
68 virtual HRESULT STDMETHODCALLTYPE
IncludeObject(IShellView
* ppshv
, LPCITEMIDLIST pidl
)
69 { //filter files if needed
73 // *** IShellBrowser methods *** (same as IOleInPlaceFrame)
74 virtual HRESULT STDMETHODCALLTYPE
InsertMenusSB(HMENU hmenuShared
, LPOLEMENUGROUPWIDTHS lpMenuWidths
) {return E_NOTIMPL
;}
75 virtual HRESULT STDMETHODCALLTYPE
SetMenuSB(HMENU hmenuShared
, HOLEMENU holemenuReserved
, HWND hwndActiveObject
) {return E_NOTIMPL
;}
76 virtual HRESULT STDMETHODCALLTYPE
RemoveMenusSB(HMENU hmenuShared
) {return E_NOTIMPL
;}
77 virtual HRESULT STDMETHODCALLTYPE
SetStatusTextSB(LPCOLESTR lpszStatusText
) {return E_NOTIMPL
;}
78 virtual HRESULT STDMETHODCALLTYPE
EnableModelessSB(BOOL fEnable
) {return E_NOTIMPL
;}
79 virtual HRESULT STDMETHODCALLTYPE
BrowseObject(LPCITEMIDLIST pidl
, UINT wFlags
) {return E_NOTIMPL
;}
80 virtual HRESULT STDMETHODCALLTYPE
GetViewStateStream(DWORD grfMode
, LPSTREAM
* ppStrm
) {return E_NOTIMPL
;}
81 virtual HRESULT STDMETHODCALLTYPE
OnViewWindowActive(IShellView
* ppshv
) {return E_NOTIMPL
;}
82 virtual HRESULT STDMETHODCALLTYPE
SetToolbarItems(LPTBBUTTON lpButtons
, UINT nButtons
, UINT uFlags
) {return E_NOTIMPL
;}
83 virtual HRESULT STDMETHODCALLTYPE
TranslateAcceleratorSB(LPMSG lpmsg
, WORD wID
) {return S_OK
;}
86 virtual HRESULT STDMETHODCALLTYPE
QueryService(REFGUID guidService
, REFIID riid
, void** ppvObject
);
89 virtual HRESULT STDMETHODCALLTYPE
QueryStatus(const GUID
*pguidCmdGroup
, ULONG cCmds
, OLECMD prgCmds
[], OLECMDTEXT
* pCmdText
);
90 virtual HRESULT STDMETHODCALLTYPE
Exec(const GUID
*pguidCmdGroup
, DWORD nCmdID
, DWORD nCmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
);
95 virtual HRESULT
OnDefaultCommand(LPIDA pida
) {return E_NOTIMPL
;}
98 #ifndef WM_GETISHELLBROWSER
99 #define WM_GETISHELLBROWSER (WM_USER+7)