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.

46 lines
1.4 KiB

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