From 66cb770a982a2502456d10d73838df2b7239fd89 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 4 Mar 2013 07:23:42 +0000 Subject: new subclassing functions applied to all plugins git-svn-id: http://svn.miranda-ng.org/main/trunk@3880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/src/Mra_functions.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'protocols/MRA/src') diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index f9a569b3d6..7d645b10c8 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -1176,9 +1176,6 @@ void EnableControlsArray(HWND hWndDlg, WORD *pwControlsList, size_t dwControlsLi LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - LRESULT lrRet = 0; - WNDPROC OldMessageEditProc = (WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA); - if (msg == WM_CHAR) if (GetKeyState(VK_CONTROL) & 0x8000) { if (wParam == '\n') { @@ -1195,10 +1192,7 @@ LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPA } } - if (OldMessageEditProc) - lrRet = CallWindowProc(OldMessageEditProc, hwnd, msg, wParam, lParam); - - return lrRet; + return mir_callNextSubclass(hwnd, MessageEditSubclassProc, msg, wParam, lParam); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -1215,20 +1209,13 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP dat = (SetXStatusData*)lParam; if (dat) { char szValueName[MAX_PATH]; - HWND hWndEdit; WCHAR szBuff[STATUS_TITLE_MAX+STATUS_DESC_MAX]; - WNDPROC OldMessageEditProc; dat->hDlgIcon = IconLibGetIcon(hXStatusAdvancedStatusIcons[dat->dwXStatus]); dat->dwCountdown = 5; - hWndEdit = GetDlgItem(hWndDlg, IDC_XTITLE); - OldMessageEditProc = (WNDPROC)SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)MessageEditSubclassProc); - SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)OldMessageEditProc); - - hWndEdit = GetDlgItem(hWndDlg, IDC_XMSG); - OldMessageEditProc = (WNDPROC)SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)MessageEditSubclassProc); - SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)OldMessageEditProc); + mir_subclassWindow( GetDlgItem(hWndDlg, IDC_XTITLE), MessageEditSubclassProc); + mir_subclassWindow( GetDlgItem(hWndDlg, IDC_XMSG), MessageEditSubclassProc); SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)dat); SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_XTITLE, EM_LIMITTEXT, STATUS_TITLE_MAX, 0); -- cgit v1.2.3