Leaked source code of windows server 2003
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.

56 lines
2.0 KiB

  1. //
  2. // Plug-in to enumerate a list of folders from a registry key
  3. //
  4. //
  5. // Property bag:
  6. //
  7. // "Target" - name of registry key to enumerate
  8. //
  9. #include "sfthost.h"
  10. class SpecialFolderList : public SFTBarHost
  11. {
  12. public:
  13. friend SFTBarHost *SpecList_CreateInstance()
  14. { return new SpecialFolderList(); }
  15. SpecialFolderList() : SFTBarHost(HOSTF_CANRENAME | HOSTF_REVALIDATE |
  16. HOSTF_RELOADTEXT |
  17. HOSTF_CASCADEMENU)
  18. {
  19. _iThemePart = SPP_PLACESLIST;
  20. _iThemePartSep = SPP_PLACESLISTSEPARATOR;
  21. }
  22. private:
  23. ~SpecialFolderList();
  24. HRESULT Initialize();
  25. void EnumItems();
  26. int CompareItems(PaneItem *p1, PaneItem *p2);
  27. HRESULT GetFolderAndPidl(PaneItem *pitem, IShellFolder **ppsfOut, LPCITEMIDLIST *ppidlOut);
  28. HRESULT ContextMenuRenameItem(PaneItem *p, LPCTSTR ptszNewName);
  29. BOOL IsItemStillValid(PaneItem *p);
  30. HRESULT GetCascadeMenu(PaneItem *pitem, IShellMenu **ppsm);
  31. int ReadIconSize() { return ICONSIZE_MEDIUM; }
  32. BOOL NeedBackgroundEnum() { return TRUE; }
  33. int AddImageForItem(PaneItem *p, IShellFolder *psf, LPCITEMIDLIST pidl, int iPos);
  34. LPTSTR DisplayNameOfItem(PaneItem *p, IShellFolder *psf, LPCITEMIDLIST pidlItem, SHGNO shgno);
  35. TCHAR GetItemAccelerator(PaneItem *pitem, int iItemStart);
  36. void OnChangeNotify(UINT id, LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  37. BOOL IsBold(PaneItem *pitem);
  38. void GetItemInfoTip(PaneItem *pitem, LPTSTR pszText, DWORD cch);
  39. void UpdateImage(int iImage) { }
  40. HRESULT ContextMenuInvokeItem(PaneItem *p, IContextMenu *pcm, CMINVOKECOMMANDINFOEX *pici, LPCTSTR pszVerb);
  41. UINT AdjustDeleteMenuItem(PaneItem *pitem, UINT *puiFlags);
  42. LRESULT OnWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  43. HRESULT _GetUIObjectOfItem(PaneItem *p, REFIID riid, LPVOID *ppv);
  44. private:
  45. static DWORD WINAPI _HasEnoughChildrenThreadProc(LPVOID pvData);
  46. UINT _cNotify;
  47. };