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.

47 lines
1.3 KiB

  1. #ifndef _MENUISF_H
  2. #define _MENUISF_H
  3. #include "iface.h"
  4. #include "caggunk.h"
  5. #include "menubar.h"
  6. // Object that uses TrackPopupMenu as its implementation for IMenuPopup.
  7. //
  8. class CTrackPopupBar : public CMenuDeskBar
  9. {
  10. public:
  11. // *** IUnknown methods ***
  12. STDMETHOD(QueryInterface) (REFIID riid, LPVOID * ppvObj);
  13. STDMETHOD_(ULONG,AddRef) () ;
  14. STDMETHOD_(ULONG,Release) ();
  15. // *** IServiceProvider methods ***
  16. virtual STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void **ppvObj);
  17. // *** IOleWindow methods ***
  18. virtual STDMETHODIMP GetWindow(HWND * phwnd) { return E_NOTIMPL; }
  19. virtual STDMETHODIMP ContextSensitiveHelp(BOOL bEnterMode) { return E_NOTIMPL; }
  20. // *** IMenuPopup methods ***
  21. virtual STDMETHODIMP OnSelect(DWORD dwSelectType);
  22. virtual STDMETHODIMP SetSubMenu(IMenuPopup* pmp, BOOL fSet);
  23. virtual STDMETHODIMP Popup(POINTL *ppt, RECTL *prcExclude, DWORD dwFlags);
  24. CTrackPopupBar(void* pvContext, int id, HMENU hmenu, HWND hwnd);
  25. ~CTrackPopupBar();
  26. HMENU GetPopupMenu() { return GetSubMenu(_hmenu, _id); };
  27. void SelectFirstItem();
  28. protected:
  29. int _id;
  30. HMENU _hmenu;
  31. HWND _hwndParent;
  32. void* _pvContext;
  33. // Popup message to indicate - "Ignore next MENUSELECT clear msg"
  34. UINT _nMBIgnoreNextDeselect;
  35. };
  36. #endif