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.

136 lines
3.0 KiB

  1. //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
  2. //
  3. // itemmenu.h
  4. //
  5. // Conext menu interface for items.
  6. //
  7. // History:
  8. //
  9. // 3/26/97 edwardp Created.
  10. //
  11. ////////////////////////////////////////////////////////////////////////////////
  12. //
  13. // Check for previous includes of this file.
  14. //
  15. #ifndef _ITEMMENU_H_
  16. #define _ITEMMENU_H_
  17. //
  18. // Function prototypes.
  19. //
  20. //
  21. // REVIEW: Prototype for DoFileDownloadEx
  22. // This function is exported from shdocvw, but doesn't have a prototype
  23. // defined in any .h file.
  24. //
  25. HRESULT WINAPI DoFileDownloadEx(LPCWSTR pwszURL, BOOL fSaveAs);
  26. //
  27. // Use a flag to conditionally compile code that uses the default context menu
  28. // handler implemented in shell32.dll.
  29. //
  30. #define USE_DEFAULT_MENU_HANDLER 0
  31. #if USE_DEFAULT_MENU_HANDLER
  32. //
  33. //
  34. //
  35. HRESULT CALLBACK MenuCallBack(IShellFolder* pIShellFolder,
  36. HWND hwndOwner,
  37. LPDATAOBJECT pdtobj,
  38. UINT uMsg,
  39. WPARAM wParam,
  40. LPARAM lParam);
  41. #else // USE_DEFAULT_MENU_HANDLER
  42. //
  43. // Defines
  44. //
  45. #define MAX_PROP_PAGES 5
  46. //
  47. // Function prototypes
  48. //
  49. BOOL CALLBACK AddPages_Callback(HPROPSHEETPAGE hpage, LPARAM ppsh);
  50. //
  51. // Class definition for the item context menu class.
  52. //
  53. class CContextMenu : public IContextMenu2
  54. {
  55. //
  56. // Methods
  57. //
  58. public:
  59. // Constructor
  60. CContextMenu(PCDFITEMIDLIST* apcdfidl,
  61. LPITEMIDLIST pidlPath, UINT nCount);
  62. // IUnknown
  63. STDMETHODIMP QueryInterface(REFIID, void **);
  64. STDMETHODIMP_(ULONG) AddRef(void);
  65. STDMETHODIMP_(ULONG) Release(void);
  66. // IContextMenu methods.
  67. STDMETHODIMP QueryContextMenu(HMENU hmenu,
  68. UINT indexMenu,
  69. UINT idCmdFirst,
  70. UINT idCmdLast,
  71. UINT uFlags);
  72. STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpici);
  73. STDMETHODIMP GetCommandString(UINT_PTR idCommand,
  74. UINT uFLags,
  75. UINT *pwReserved,
  76. LPSTR pszName,
  77. UINT cchMax);
  78. // IContextMenu2 methods.
  79. STDMETHODIMP HandleMenuMsg(UINT uMsg,
  80. WPARAM wParam,
  81. LPARAM lParam);
  82. private:
  83. // Destructor.
  84. ~CContextMenu(void);
  85. // Helper functions.
  86. HRESULT DoOpen(HWND hwnd, int nShow);
  87. HRESULT DoOpenFolder(HWND hwnd, int nShow);
  88. HRESULT DoOpenStory(HWND hwnd, int nShow);
  89. HRESULT DoProperties(HWND hwnd);
  90. HRESULT QueryInternetShortcut(PCDFITEMIDLIST pcdfidl, REFIID riid,
  91. void** ppvOut);
  92. //
  93. // Member variables.
  94. //
  95. private:
  96. ULONG m_cRef;
  97. UINT m_nCount;
  98. PCDFITEMIDLIST* m_apcdfidl;
  99. LPITEMIDLIST m_pidlPath;
  100. };
  101. #endif // USE_DEFAULT_MENU_HANDLER
  102. #endif // _ITEMMENU_H_