1 /* 2 * PROJECT: shell32 3 * LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+) 4 * PURPOSE: IShellDispatch implementation 5 * COPYRIGHT: Copyright 2015-2018 Mark Jansen (mark.jansen@reactos.org) 6 */ 7 8 #ifndef _SHELLDISPATCH_H_ 9 #define _SHELLDISPATCH_H_ 10 11 #undef ShellExecute 12 13 class CShellDispatch: 14 public CComCoClass<CShellDispatch, &CLSID_Shell>, 15 public CComObjectRootEx<CComMultiThreadModelNoCS>, 16 public IDispatchImpl<IShellDispatch4, &IID_IShellDispatch4>, 17 public IObjectSafety, 18 public IObjectWithSite 19 { 20 private: 21 22 public: 23 CShellDispatch(); 24 ~CShellDispatch(); 25 26 HRESULT Initialize(); 27 28 // *** IShellDispatch methods *** 29 STDMETHOD(get_Application)(IDispatch **ppid) override; 30 STDMETHOD(get_Parent)(IDispatch **ppid) override; 31 STDMETHOD(NameSpace)(VARIANT vDir, Folder **ppsdf) override; 32 STDMETHOD(BrowseForFolder)(LONG Hwnd, BSTR Title, LONG Options, VARIANT RootFolder, Folder **ppsdf) override; 33 STDMETHOD(Windows)(IDispatch **ppid) override; 34 STDMETHOD(Open)(VARIANT vDir) override; 35 STDMETHOD(Explore)(VARIANT vDir) override; 36 STDMETHOD(MinimizeAll)() override; 37 STDMETHOD(UndoMinimizeALL)() override; 38 STDMETHOD(FileRun)() override; 39 STDMETHOD(CascadeWindows)() override; 40 STDMETHOD(TileVertically)() override; 41 STDMETHOD(TileHorizontally)() override; 42 STDMETHOD(ShutdownWindows)() override; 43 STDMETHOD(Suspend)() override; 44 STDMETHOD(EjectPC)() override; 45 STDMETHOD(SetTime)() override; 46 STDMETHOD(TrayProperties)() override; 47 STDMETHOD(Help)() override; 48 STDMETHOD(FindFiles)() override; 49 STDMETHOD(FindComputer)() override; 50 STDMETHOD(RefreshMenu)() override; 51 STDMETHOD(ControlPanelItem)(BSTR szDir) override; 52 53 // *** IShellDispatch2 methods *** 54 STDMETHOD(IsRestricted)(BSTR group, BSTR restriction, LONG *value) override; 55 STDMETHOD(ShellExecute)(BSTR file, VARIANT args, VARIANT dir, VARIANT op, VARIANT show) override; 56 STDMETHOD(FindPrinter)(BSTR name, BSTR location, BSTR model) override; 57 STDMETHOD(GetSystemInformation)(BSTR name, VARIANT *ret) override; 58 STDMETHOD(ServiceStart)(BSTR service, VARIANT persistent, VARIANT *ret) override; 59 STDMETHOD(ServiceStop)(BSTR service, VARIANT persistent, VARIANT *ret) override; 60 STDMETHOD(IsServiceRunning)(BSTR service, VARIANT *running) override; 61 STDMETHOD(CanStartStopService)(BSTR service, VARIANT *ret) override; 62 STDMETHOD(ShowBrowserBar)(BSTR clsid, VARIANT show, VARIANT *ret) override; 63 64 // *** IShellDispatch3 methods *** 65 STDMETHOD(AddToRecent)(VARIANT file, BSTR category) override; 66 67 // *** IShellDispatch4 methods *** 68 STDMETHOD(WindowsSecurity)() override; 69 STDMETHOD(ToggleDesktop)() override; 70 STDMETHOD(ExplorerPolicy)(BSTR policy, VARIANT *value) override; 71 STDMETHOD(GetSetting)(LONG setting, VARIANT_BOOL *result) override; 72 73 // *** IObjectSafety methods *** 74 STDMETHOD(GetInterfaceSafetyOptions)(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) override; 75 STDMETHOD(SetInterfaceSafetyOptions)(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) override; 76 77 // *** IObjectWithSite methods *** 78 STDMETHOD(SetSite)(IUnknown *pUnkSite) override; 79 STDMETHOD(GetSite)(REFIID riid, PVOID *ppvSite) override; 80 81 DECLARE_REGISTRY_RESOURCEID(IDR_SHELL) 82 DECLARE_NOT_AGGREGATABLE(CShellDispatch) 83 84 DECLARE_PROTECT_FINAL_CONSTRUCT() 85 86 BEGIN_COM_MAP(CShellDispatch) 87 COM_INTERFACE_ENTRY_IID(IID_IShellDispatch4, IShellDispatch4) 88 COM_INTERFACE_ENTRY_IID(IID_IShellDispatch3, IShellDispatch3) 89 COM_INTERFACE_ENTRY_IID(IID_IShellDispatch2, IShellDispatch2) 90 COM_INTERFACE_ENTRY_IID(IID_IShellDispatch, IShellDispatch) 91 COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch) 92 COM_INTERFACE_ENTRY_IID(IID_IObjectSafety, IObjectSafety) 93 COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite) 94 END_COM_MAP() 95 }; 96 97 #endif /* _SHELLDISPATCH_H_ */ 98