| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #pragma once
- #include "../pch/pch.h"
- #include <zpzDll/zpzDll.h>
- #include "../helper/WndHelper.h"
- #include "CMenuWnd.h"
- class CValueWnd : public CWindowWnd, public INotifyUI, public IMessageFilterUI
- {
- public:
- LPCTSTR GetWindowClassName() const
- {
- return _T("UIValueFrame");
- };
- UINT GetClassStyle() const
- {
- return UI_CLASSSTYLE_DIALOG;
- };
- void OnFinalMessage(HWND /*hWnd*/)
- {
- //m_pm.RemovePreMessageFilter(this);
- delete this;
- };
- void Notify(TNotifyUI& msg);
- LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnRButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnKexianUpdate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnWatchWndUpdate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
- LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
- //添加托盘图标(初始化)
- void AddTrayIcon();
- //处理托盘图标上的事件
- LRESULT OnTrayIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- void Init();
- void ReadValue();
- void WatchWnd();
- private:
- void UpdateKexian(const char* data, int length);
- void FindValueWnd(std::wstring value);
- void InitWndPos();
- public:
- CPaintManagerUI m_pm;
- private:
- HWND m_watchWnd = NULL;
- string m_watchValue;
- //定义托盘图标对象
- NOTIFYICONDATA m_trayIcon;
- //菜单窗口
- CMenuWnd* pMenu;
- };
|