CMainWnd.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  38. LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  39. LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  40. LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  41. LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  42. LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  43. LRESULT OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  44. LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  45. LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
  46. //添加托盘图标(初始化)
  47. void AddTrayIcon();
  48. //处理托盘图标上的事件
  49. LRESULT OnTrayIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  50. public:
  51. CPaintManagerUI m_pm;
  52. private:
  53. CButtonUI* m_pCloseBtn;
  54. CButtonUI* m_pMaxBtn;
  55. CButtonUI* m_pRestoreBtn;
  56. CButtonUI* m_pMinBtn;
  57. //定义托盘图标对象
  58. NOTIFYICONDATA m_trayIcon;
  59. CMessagePush* m_push = NULL;
  60. };