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.

93 lines
3.4 KiB

  1. HRESULT GetElementRootHWNDElement(Element *pe, HWNDElement **pphwndeRoot);
  2. HRESULT GetElementRootHWND(Element *pe, HWND *phwnd);
  3. class ActionTask: public Element
  4. {
  5. public:
  6. static HRESULT Create(OUT Element** ppElement) { return Create(0, NULL, NULL, NULL, NULL, ppElement); }
  7. static HRESULT Create(UINT nActive, OUT Element** ppElement) { return Create(nActive, NULL, NULL, NULL, NULL, ppElement); }
  8. static HRESULT Create(UINT nActive, IUICommand* puiCommand, IShellItemArray* psiItemArray, CDUIView* pDUIView, CDefView* pDefView, OUT Element** ppElement);
  9. // System event callbacks
  10. virtual void OnPropertyChanged(PropertyInfo* ppi, int iIndex, Value* pvOld, Value* pvNew);
  11. // Generic events
  12. virtual void OnEvent(Event* pEvent);
  13. // ClassInfo accessors (static and virtual instance-based)
  14. static IClassInfo* Class;
  15. virtual IClassInfo* GetClassInfo() { return Class; }
  16. static HRESULT Register();
  17. void UpdateTaskUI();
  18. ActionTask();
  19. virtual ~ActionTask();
  20. protected:
  21. HRESULT Initialize(IUICommand* puiCommand, IShellItemArray* psiItemArray, CDUIView* pDUIView, CDefView* pDefView);
  22. HRESULT InitializeElement(); // init ActionTask DUI Element
  23. HRESULT InitializeButton(); // init ActionTask's DUI Button
  24. HRESULT ShowInfotipWindow(BOOL bShow);
  25. private:
  26. Button* _peButton;
  27. IUICommand* _puiCommand;
  28. IShellItemArray* _psiItemArray;
  29. CDUIView* _pDUIView; // weak link - do not ref.
  30. CDefView* _pDefView;
  31. HWND _hwndRoot; // cache of root hwnd element's hwnd
  32. BOOL _bInfotip; // TRUE if infotip has been created
  33. };
  34. class DestinationTask: public Element
  35. {
  36. public:
  37. static HRESULT Create(OUT Element** ppElement) { return Create(0, NULL, NULL, NULL, ppElement); }
  38. static HRESULT Create(UINT nActive, OUT Element** ppElement) { return Create(nActive, NULL, NULL, NULL, ppElement); }
  39. static HRESULT Create(UINT nActive, LPITEMIDLIST pidl, CDUIView* pDUIView, CDefView* pDefView, OUT Element** ppElement);
  40. // System event callbacks
  41. virtual void OnPropertyChanged(PropertyInfo* ppi, int iIndex, Value* pvOld, Value* pvNew);
  42. // Generic events
  43. virtual void OnEvent(Event* pEvent);
  44. virtual UINT MessageCallback(GMSG* pGMsg);
  45. // ClassInfo accessors (static and virtual instance-based)
  46. static IClassInfo* Class;
  47. virtual IClassInfo* GetClassInfo() { return Class; }
  48. static HRESULT Register();
  49. DestinationTask();
  50. virtual ~DestinationTask();
  51. protected:
  52. HRESULT Initialize(LPITEMIDLIST pidl, CDUIView* pDUIView, CDefView *pDefView);
  53. HRESULT InitializeElement(); // init DestinationTask DUI Element
  54. HRESULT InitializeButton(HICON hIcon, LPCWSTR pwszTitle); // init DestinationTask's DUI Button
  55. HRESULT InvokePidl();
  56. HRESULT OnContextMenu(POINT *ppt);
  57. HRESULT ShowInfotipWindow(BOOL bShow);
  58. HWND GetHWND()
  59. {
  60. if (!_peHost)
  61. GetElementRootHWNDElement(this, &_peHost);
  62. return _peHost ? _peHost->GetHWND() : NULL;
  63. }
  64. private:
  65. Button* _peButton;
  66. LPITEMIDLIST _pidlDestination;
  67. CDUIView* _pDUIView;
  68. CDefView* _pDefView;
  69. HWND _hwndRoot; // cache of root hwnd element's hwnd
  70. BOOL _bInfotip; // TRUE if infotip has been created
  71. // Caching host information
  72. HWNDElement * _peHost;
  73. };