CToastWnd.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #pragma once
  2. #include "../pch/pch.h"
  3. #include "CMainWnd.h"
  4. class CToastWnd : public CWindowWnd, public INotifyUI, public IMessageFilterUI
  5. {
  6. public:
  7. LPCTSTR GetWindowClassName() const
  8. {
  9. return _T("UIMemoWndFrame");
  10. };
  11. UINT GetClassStyle() const
  12. {
  13. return UI_CLASSSTYLE_DIALOG;
  14. };
  15. void OnFinalMessage(HWND /*hWnd*/)
  16. {
  17. //WindowImplBase::OnFinalMessage(hWnd);
  18. m_pm.RemovePreMessageFilter(this);
  19. //delete this;
  20. };
  21. void Init();
  22. void SetToast(std::wstring toast);
  23. void Notify(TNotifyUI& msg);
  24. LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  25. LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  26. {
  27. if (::IsIconic(*this))
  28. {
  29. bHandled = FALSE;
  30. }
  31. return (wParam == 0) ? TRUE : FALSE;
  32. }
  33. LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  34. {
  35. return 0;
  36. }
  37. LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  38. {
  39. return 0;
  40. }
  41. LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  42. LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  43. LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  44. LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
  45. LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
  46. public:
  47. CPaintManagerUI m_pm;
  48. };