自定义类处理消息循环HWND_MESSAGE
来源:互联网 发布:php 编译扩展dll 编辑:程序博客网 时间:2024/06/05 22:31
LRESULT CALLBACK CCustomMsgObject::__WindowProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam){CCustomMsgObject* pThis = NULL;if (uMsg == WM_NCCREATE) {LPCREATESTRUCT lpCS = reinterpret_cast<LPCREATESTRUCT>(lParam);pThis = static_cast<CCustomMsgObject*>(lpCS->lpCreateParams);ATLASSERT(NULL != pThis);::SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LONG>(pThis));} else {pThis = reinterpret_cast<CCustomMsgObject*>(::GetWindowLongPtr(hwnd, GWLP_USERDATA));if (NULL == pThis || pThis->m_hWnd != hwnd) {return ::DefWindowProc(hwnd, uMsg, wParam, lParam);}return pThis->HandleMessage(uMsg, wParam, lParam);}return ::DefWindowProc(hwnd, uMsg, wParam, lParam);}LRESULT CCustomMsgObject::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam){if (uMsg == WM_COPYDATA) {if (OnCopyData((HWND)wParam, (COPYDATASTRUCT*)lParam)) {return S_OK;}}return ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);}void CCustomMsgObject::CreateMsgPumpWnd(){if (m_hWnd != NULL) return;HINSTANCE hInst = GetModuleHandle(0);LPCTSTR lpWndClsName = _T("wndClsMsgPumpWnd");WNDCLASS wc = {0};wc.lpszClassName = lpWndClsName;wc.style = CS_NOCLOSE;wc.hInstance = hInst;wc.lpfnWndProc = __WindowProc;ATLVERIFY(RegisterClass(&wc));m_hWnd = CreateWindow(lpWndClsName, 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInst, this);}
0 0
- 自定义类处理消息循环HWND_MESSAGE
- 消息和消息处理之消息循环
- 自定义消息的处理
- 处理自定义消息
- 自定义消息处理示例
- NSNotificationCenter 处理自定义消息
- 添加自定义消息处理
- Windows OS 消息泵(消息循环处理)
- 3消息循环中的消息处理
- 3消息循环中的消息处理附图
- Windows OS 消息泵(消息循环处理)
- 如何处理自定义消息 (非命令消息)
- Message消息重载、自定义消息处理过程
- C# 实现自定义消息处理
- VC++对于自定义消息处理
- MFC中自定义消息处理
- VC++如何处理自定义消息
- MFC中自定义消息处理
- 进程上下文与中断上下文
- Uva -ALL in all
- usb-creator-gtk
- Android 文件打开方式
- PIE兼容IE的圆角实现
- 自定义类处理消息循环HWND_MESSAGE
- Hibernate实体映射
- strlen() sizeof() lenth()函数的返回值问题
- 最长上升子序列
- Linux之网络配置(不断更新中)
- Java在linux环境下创建文件夹的方法
- uva-10905-Childden’s game
- Delphi清理释放本程序内存的代码
- android文件打开及Intent及使用