soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SHostMgr.h
1#ifndef __SHOSTMGR__H__
2#define __SHOSTMGR__H__
3
4#include <core/SSingleton2.h>
5
6SNSBEGIN
7
8/**
9 * @class SHostMgr
10 * @brief 管理宿主窗口消息处理的单例类
11 */
12class SOUI_EXP SHostMgr : public SSingleton2<SHostMgr> {
13 SINGLETON2_TYPE(SINGLETON_HOSTMGR)
14 friend class SHostWnd;
15
16 public:
17 /**
18 * @brief 构造函数
19 */
20 SHostMgr(void);
21
22 /**
23 * @brief 析构函数
24 */
25 ~SHostMgr(void);
26
27 /**
28 * @brief 分发消息到宿主窗口
29 * @param uMsg 消息ID
30 * @param wp 附加参数1
31 * @param lp 附加参数2
32 */
33 void DispatchMessage(UINT uMsg, WPARAM wp = 0, LPARAM lp = 0);
34
35 protected:
36 /**
37 * @brief 添加宿主窗口消息处理程序
38 * @param hHost 宿主窗口句柄
39 * @return 成功返回TRUE,失败返回FALSE
40 */
41 bool AddHostMsgHandler(HWND hHost);
42
43 /**
44 * @brief 移除宿主窗口消息处理程序
45 * @param hHost 宿主窗口句柄
46 * @return 成功返回TRUE,失败返回FALSE
47 */
48 bool RemoveHostMsgHandler(HWND hHost);
49
50 protected:
51 SMap<HWND, bool> m_mapHostMsgHandler; ///< 宿主窗口消息处理程序映射表
52 SCriticalSection m_cs; ///< 临界区对象,用于线程同步
53};
54
55SNSEND
56
57#endif // __SHOSTMGR__H__
Pseudo-Singleton Template.
Wrapper class for a critical section.
bool RemoveHostMsgHandler(HWND hHost)
移除宿主窗口消息处理程序
Definition SHostMgr.cpp:22
bool AddHostMsgHandler(HWND hHost)
添加宿主窗口消息处理程序
Definition SHostMgr.cpp:13
void DispatchMessage(UINT uMsg, WPARAM wp=0, LPARAM lp=0)
分发消息到宿主窗口
Definition SHostMgr.cpp:28
SCriticalSection m_cs
临界区对象,用于线程同步
Definition SHostMgr.h:52
SHostMgr(void)
构造函数
Definition SHostMgr.cpp:5
SMap< HWND, bool > m_mapHostMsgHandler
宿主窗口消息处理程序映射表
Definition SHostMgr.h:51