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.

69 lines
2.4 KiB

  1. //
  2. // publics for defcm
  3. //
  4. // Some code that knows defcm will be used likes to prepare the menu first.
  5. // If you do this, you must call SHPrettyMenuForDefcm instead of _SHPrettyMenu
  6. HRESULT SHPrepareMenuForDefcm(HMENU hmenu, UINT indexMenu, UINT uFlags, UINT idCmdFirst, UINT idCmdLast); // sets things up
  7. HRESULT SHPrettyMenuForDefcm(HMENU hmenu, UINT uFlags, UINT idCmdFirst, UINT idCmdLast, HRESULT hrPrepare); // cleans things up part way
  8. HRESULT SHUnprepareMenuForDefcm(HMENU hmenu, UINT idCmdFirst, UINT idCmdLast); // cleans things up the rest of the way (not required if you're just destroying the menu)
  9. STDAPI CDefFolderMenu_CreateHKeyMenu(HWND hwndOwner, HKEY hkey, IContextMenu **ppcm);
  10. STDAPI CDefFolderMenu_Create2Ex(LPCITEMIDLIST pidlFolder, HWND hwnd,
  11. UINT cidl, LPCITEMIDLIST *apidl,
  12. IShellFolder *psf, IContextMenuCB *pcmcb,
  13. UINT nKeys, const HKEY *ahkeyClsKeys,
  14. IContextMenu **ppcm);
  15. STDAPI CDefFolderMenu_CreateEx(LPCITEMIDLIST pidlFolder,
  16. HWND hwnd, UINT cidl, LPCITEMIDLIST *apidl,
  17. IShellFolder *psf, IContextMenuCB *pcmcb,
  18. HKEY hkeyProgID, HKEY hkeyBaseProgID,
  19. IContextMenu **ppcm);
  20. STDAPI_(void) DrawMenuItem(DRAWITEMSTRUCT* pdi, LPCTSTR pszText, UINT iIcon);
  21. STDAPI_(LRESULT) MeasureMenuItem(MEASUREITEMSTRUCT *pmi, LPCTSTR pszText);
  22. typedef struct {
  23. UINT max;
  24. struct {
  25. UINT id;
  26. UINT fFlags;
  27. } list[2];
  28. } IDMAPFORQCMINFO;
  29. extern const IDMAPFORQCMINFO g_idMap;
  30. typedef struct {
  31. HWND hwnd;
  32. IContextMenuCB *pcmcb;
  33. LPCITEMIDLIST pidlFolder;
  34. IShellFolder *psf;
  35. UINT cidl;
  36. LPCITEMIDLIST *apidl;
  37. IAssociationArray *paa;
  38. UINT cKeys;
  39. const HKEY *aKeys;
  40. } DEFCONTEXTMENU;
  41. STDAPI CreateDefaultContextMenu(DEFCONTEXTMENU *pdcm, IContextMenu **ppcm);
  42. class CDefBackgroundMenuCB : public IContextMenuCB
  43. {
  44. public:
  45. CDefBackgroundMenuCB(LPCITEMIDLIST pidlFolder);
  46. // IUnknown
  47. STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
  48. STDMETHODIMP_(ULONG) AddRef();
  49. STDMETHODIMP_(ULONG) Release();
  50. // IContextMenuCB
  51. STDMETHODIMP CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam);
  52. private:
  53. virtual ~CDefBackgroundMenuCB();
  54. LPITEMIDLIST _pidlFolder;
  55. LONG _cRef;
  56. };