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.

92 lines
3.0 KiB

  1. #ifndef _BSMENU_H
  2. #define _BSMENU_H
  3. #include "comcatex.h"
  4. typedef struct {
  5. CLSID clsid;
  6. CATID catid;
  7. UINT idCmd;
  8. LPTSTR pszName;
  9. LPTSTR pszIcon;
  10. LPTSTR pszMenu;
  11. LPTSTR pszHelp;
  12. LPTSTR pszMenuPUI;
  13. LPTSTR pszHelpPUI;
  14. } BANDCLASSINFO;
  15. class CBandSiteMenu :
  16. public IContextMenu3,
  17. public IShellService
  18. {
  19. public:
  20. CBandSiteMenu();
  21. STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  22. STDMETHODIMP_(ULONG) AddRef(void) ;
  23. STDMETHODIMP_(ULONG) Release(void);
  24. // *** IContextMenu3 methods ***
  25. STDMETHOD(QueryContextMenu)(HMENU hmenu,
  26. UINT indexMenu,
  27. UINT idCmdFirst,
  28. UINT idCmdLast,
  29. UINT uFlags);
  30. STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO lpici);
  31. STDMETHOD(GetCommandString)(UINT_PTR idCmd,
  32. UINT uType,
  33. UINT * pwReserved,
  34. LPSTR pszName,
  35. UINT cchMax) { return E_NOTIMPL; };
  36. STDMETHOD(SetOwner)(IUnknown* punk);
  37. STDMETHOD(HandleMenuMsg)(UINT uMsg,
  38. WPARAM wParam,
  39. LPARAM lParam);
  40. STDMETHOD(HandleMenuMsg2)(UINT uMsg,
  41. WPARAM wParam,
  42. LPARAM lParam,
  43. LRESULT* plres);
  44. BOOL GetMergeMenu() { return (_hdpaBandClasses ? TRUE:FALSE) ; }
  45. int LoadFromComCat(const CATID *pcatid);
  46. int GetBandClassCount(const CATID* pcatid, BOOL bMergedOnly );
  47. BANDCLASSINFO * GetBandClassDataStruct(UINT uBand);
  48. BOOL DeleteBandClass( REFCLSID rclsid );
  49. int CreateMergeMenu(HMENU hmenu, UINT cMax, UINT iPosition, UINT idCmdFirst, UINT iStart, BOOL fMungeAllowed = TRUE);
  50. protected:
  51. ~CBandSiteMenu();
  52. HDPA _hdpaBandClasses; // what bands are insertable here?
  53. int _idCmdEnumFirst; // this is in EXTERNAL units
  54. UINT _idCmdFirst;
  55. UINT _cRef;
  56. IBandSite* _pbs;
  57. static int _DPA_FreeBandClassInfo(LPVOID p, LPVOID d);
  58. BOOL _CheckUnique(IDeskBand* pdb, HMENU hmenu) ;
  59. HRESULT _GetBandIdentifiers(IUnknown *punk, CLSID* pcslid, DWORD* pdwPrivID);
  60. void _AddNewFSBand(LPCITEMIDLIST pidl, BOOL fNoTitle, DWORD dwPrivID);
  61. void _ToggleSpecialFolderBand(int i, LPTSTR pszSubPath, BOOL fNoTitle);
  62. void _BrowseForNewFolderBand();
  63. void _ToggleComcatBand(UINT idCmd);
  64. void _AddEnumMenu(HMENU hmenu, int iInsert);
  65. static HRESULT _BandClassEnum(REFCATID rcatid, REFCLSID rclsid, LPARAM lParam);
  66. HRESULT _FindBand(const CLSID* pclsid, DWORD dwPrivID, DWORD* pdwBandID);
  67. UINT _IDToInternal(UINT uID);
  68. UINT _IDToExternal(UINT uID);
  69. LRESULT _OnInitMenuPopup(HMENU hmenu, UINT uPos);
  70. void _PopulateSubmenu(HMENU hmenuSub);
  71. };
  72. #endif // _BSMENU_H