Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.0 KiB

  1. #ifndef _OPTIONS_H_
  2. #define _OPTIONS_H_
  3. #include <iethread.h>
  4. #include <browseui.h>
  5. #include "cowsite.h"
  6. void DoGlobalFolderOptions(void);
  7. class CFolderOptionsPsx :
  8. public
  9. IShellPropSheetExt,
  10. IShellExtInit,
  11. CObjectWithSite
  12. {
  13. public:
  14. // IUnknown
  15. STDMETHOD(QueryInterface)(REFIID riid, void **ppvObj);
  16. STDMETHOD_(ULONG,AddRef)(void);
  17. STDMETHOD_(ULONG,Release)(void);
  18. // IShellPropSheetExt
  19. STDMETHOD(AddPages)(THIS_ LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam);
  20. STDMETHOD(ReplacePage)(THIS_ UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam);
  21. // IShellExtInit
  22. STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
  23. void SetNeedRefresh(BOOL fNeedRefresh) { m_fNeedRefresh = fNeedRefresh; }
  24. BOOL NeedRefresh() { return m_fNeedRefresh; }
  25. BOOL HasBrowserService() { return m_pbs2 != NULL; }
  26. void SetAsDefFolderSettings()
  27. { if (HasBrowserService()) m_pbs2->SetAsDefFolderSettings(); }
  28. HRESULT GetDefFolderSettings(DEFFOLDERSETTINGS *pdfs, int cbDfs)
  29. { return m_pgfs->Get(pdfs, cbDfs); }
  30. HRESULT SetDefFolderSettings(const DEFFOLDERSETTINGS *pdfs, int cbDfs, UINT flags)
  31. { return m_pgfs->Set(pdfs, cbDfs, flags); }
  32. HRESULT ResetDefFolderSettings()
  33. { IUnknown_Exec(m_pbs2, &CGID_DefView, DVID_RESETDEFAULT, OLECMDEXECOPT_DODEFAULT, NULL, NULL);
  34. return m_pgfs->Set(NULL, 0, GFSS_SETASDEFAULT); }
  35. private:
  36. CFolderOptionsPsx();
  37. ~CFolderOptionsPsx();
  38. LONG m_cRef;
  39. BOOL m_fNeedRefresh;
  40. IBrowserService2 *m_pbs2;
  41. IGlobalFolderSettings *m_pgfs;
  42. friend HRESULT CFolderOptionsPsx_CreateInstance(IUnknown *punkOuter, REFIID riid, void **ppvOut);
  43. static UINT CALLBACK PropCallback(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);
  44. };
  45. BOOL_PTR CALLBACK FolderOptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  46. #endif // _OPTIONS_H_