CMainWnd.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #pragma once
  2. #include "../pch/pch.h"
  3. #include "../control/CWaimaiOrderItemUI.h"
  4. #include "../order/CWaimaiOrder.h"
  5. #include "../tool/CPosPrinter.h"
  6. #include <ShellAPI.h>
  7. #define WM_SHOWTASK 10001
  8. #define WM_ONCLOSE 10002
  9. class CMessagePush;
  10. class CMainWnd : public CWindowWnd, public INotifyUI
  11. {
  12. public:
  13. CMainWnd() { };
  14. LPCTSTR GetWindowClassName() const
  15. {
  16. return _T("UIMainFrame");
  17. };
  18. UINT GetClassStyle() const
  19. {
  20. return CS_DBLCLKS;
  21. };
  22. void OnFinalMessage(HWND /*hWnd*/)
  23. {
  24. delete this;
  25. };
  26. void Init();
  27. void OnPrepare()
  28. {
  29. }
  30. void Notify(TNotifyUI& msg);
  31. void HandleClickMsg(TNotifyUI& msg);
  32. void HandleSelectChangeMsg(TNotifyUI& msg);
  33. void HandleItemSelectMsg(TNotifyUI& msg);
  34. void InitSettingStatus();
  35. LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  36. LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  37. {
  38. bHandled = FALSE;
  39. return 0;
  40. }
  41. LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  42. {
  43. ::PostQuitMessage(0L);
  44. bHandled = FALSE;
  45. return 0;
  46. }
  47. LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  48. {
  49. if(::IsIconic(*this))
  50. {
  51. bHandled = FALSE;
  52. }
  53. return (wParam == 0) ? TRUE : FALSE;
  54. }
  55. LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  56. {
  57. return 0;
  58. }
  59. LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  60. {
  61. return 0;
  62. }
  63. LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  64. LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  65. LRESULT OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  66. LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  67. LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
  68. //添加托盘图标(初始化)
  69. void AddTrayIcon();
  70. //处理托盘图标上的事件
  71. LRESULT OnTrayIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  72. public:
  73. CPaintManagerUI m_pm;
  74. private:
  75. CButtonUI* m_pCloseBtn;
  76. CButtonUI* m_pMaxBtn;
  77. CButtonUI* m_pRestoreBtn;
  78. CButtonUI* m_pMinBtn;
  79. //定义托盘图标对象
  80. NOTIFYICONDATA m_trayIcon;
  81. CMessagePush* m_push;
  82. };