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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 // Martin Fuchs, 23.07.2003
27 // Credits: Thanks to Leon Finker for his explorer window example
31 struct IShellBrowserImpl : public IShellBrowser, public ICommDlgBrowser
38 STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject)
43 if (iid == IID_IUnknown)
44 *ppvObject = (IUnknown*)static_cast<IShellBrowser*>(this);
45 else if (iid == IID_IOleWindow)
46 *ppvObject = static_cast<IOleWindow*>(this);
47 else if (iid == IID_IShellBrowser)
48 *ppvObject = static_cast<IShellBrowser*>(this);
49 else if (iid == IID_ICommDlgBrowser)
50 *ppvObject = static_cast<ICommDlgBrowser*>(this);
59 STDMETHOD_(ULONG, AddRef)() {return ++_dwRef;}
60 STDMETHOD_(ULONG, Release)() {return --_dwRef;} //not heap based
62 // *** IOleWindow methods ***
63 STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) {return E_NOTIMPL;}
65 // *** ICommDlgBrowser methods ***
66 STDMETHOD(OnDefaultCommand)(struct IShellView* ppshv)
71 STDMETHOD(OnStateChange)(struct IShellView* ppshv, ULONG uChange)
72 { //handle selection, rename, focus if needed
76 STDMETHOD(IncludeObject)(struct IShellView* ppshv, LPCITEMIDLIST pidl)
77 { //filter files if needed
81 // *** IShellBrowser methods *** (same as IOleInPlaceFrame)
82 STDMETHOD(InsertMenusSB)(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) {return E_NOTIMPL;}
83 STDMETHOD(SetMenuSB)(HMENU hmenuShared, HOLEMENU holemenuReserved,HWND hwndActiveObject) {return E_NOTIMPL;}
84 STDMETHOD(RemoveMenusSB)(HMENU hmenuShared) {return E_NOTIMPL;}
85 STDMETHOD(SetStatusTextSB)(LPCOLESTR lpszStatusText) {return E_NOTIMPL;}
86 STDMETHOD(EnableModelessSB)(BOOL fEnable) {return E_NOTIMPL;}
87 STDMETHOD(BrowseObject)(LPCITEMIDLIST pidl, UINT wFlags) {return E_NOTIMPL;}
88 STDMETHOD(GetViewStateStream)(DWORD grfMode,LPSTREAM *ppStrm) {return E_NOTIMPL;}
89 STDMETHOD(OnViewWindowActive)(struct IShellView *ppshv) {return E_NOTIMPL;}
90 STDMETHOD(SetToolbarItems)(LPTBBUTTON lpButtons, UINT nButtons,UINT uFlags) {return E_NOTIMPL;}
91 STDMETHOD(TranslateAcceleratorSB)(LPMSG lpmsg, WORD wID) {return S_OK;}
97 #ifndef WM_GETISHELLBROWSER
98 #define WM_GETISHELLBROWSER (WM_USER+7)