From 011c86b22aa67f25d751f731501eaaec9600f44c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 4 Mar 2013 19:57:20 +0000 Subject: fix for the smileys cleanup procedure git-svn-id: http://svn.miranda-ng.org/main/trunk@3887 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/subclass.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mir_core/subclass.cpp b/src/mir_core/subclass.cpp index 40fa3c6b95..183556402d 100644 --- a/src/mir_core/subclass.cpp +++ b/src/mir_core/subclass.cpp @@ -33,6 +33,8 @@ struct MSubclassData static LIST arSubclass(10, LIST::FTSortFunc(HandleKeySortT)); +///////////////////////////////////////////////////////////////////////////////////////// + static LRESULT CALLBACK MSubclassWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { MSubclassData *p = arSubclass.find((MSubclassData*)&hwnd); @@ -92,6 +94,14 @@ MIR_CORE_DLL(void) mir_subclassWindowFull(HWND hWnd, WNDPROC wndProc, WNDPROC ol p->m_hooks[p->m_iHooks++] = wndProc; } +///////////////////////////////////////////////////////////////////////////////////////// + +MIR_CORE_DLL(void) mir_unsubclassWindow(HWND hWnd) +{ +} + +///////////////////////////////////////////////////////////////////////////////////////// + MIR_CORE_DLL(LRESULT) mir_callNextSubclass(HWND hWnd, WNDPROC wndProc, UINT uMsg, WPARAM wParam, LPARAM lParam) { MSubclassData *p = arSubclass.find((MSubclassData*)&hWnd); @@ -109,10 +119,17 @@ MIR_CORE_DLL(LRESULT) mir_callNextSubclass(HWND hWnd, WNDPROC wndProc, UINT uMsg delete p; SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)saveProc); - return CallWindowProc(saveProc, hWnd, uMsg, wParam, lParam); + LONG res = 0; + __try { + res = saveProc(hWnd, uMsg, wParam, lParam); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + } + return res; } - return CallWindowProc(p->m_origWndProc, hWnd, uMsg, wParam, lParam); + return p->m_origWndProc(hWnd, uMsg, wParam, lParam); } } @@ -122,6 +139,8 @@ MIR_CORE_DLL(LRESULT) mir_callNextSubclass(HWND hWnd, WNDPROC wndProc, UINT uMsg return DefWindowProc(hWnd, uMsg, wParam, lParam); } +///////////////////////////////////////////////////////////////////////////////////////// + MIR_CORE_DLL(void) KillModuleSubclassing(HMODULE hInst) { for (int i=0; i < arSubclass.getCount(); i++) { -- cgit v1.2.3