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 --- src/core/stdaway/sendmsg.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/core/stdaway/sendmsg.cpp') diff --git a/src/core/stdaway/sendmsg.cpp b/src/core/stdaway/sendmsg.cpp index e422707372..ac9c01d74d 100644 --- a/src/core/stdaway/sendmsg.cpp +++ b/src/core/stdaway/sendmsg.cpp @@ -140,12 +140,9 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto) return dbv.ptszVal; } -static WNDPROC OldMessageEditProc; - static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - switch(msg) - { + switch(msg) { case WM_CHAR: if (wParam == '\n' && GetKeyState(VK_CONTROL) & 0x8000) { @@ -181,7 +178,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar } break; } - return CallWindowProc(OldMessageEditProc, hwnd, msg, wParam, lParam); + return mir_callNextSubclass(hwnd, MessageEditSubclassProc, msg, wParam, lParam); } void ChangeAllProtoMessages(char *szProto, int statusMode, TCHAR *msg) @@ -235,7 +232,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa dat->szProto = newdat->szProto; mir_free(newdat); SendDlgItemMessage(hwndDlg, IDC_MSG, EM_LIMITTEXT, 1024, 0); - OldMessageEditProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)MessageEditSubclassProc); + mir_subclassWindow( GetDlgItem(hwndDlg, IDC_MSG), MessageEditSubclassProc); { TCHAR str[256], format[128]; GetWindowText(hwndDlg, format, SIZEOF(format)); @@ -310,7 +307,6 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa KillTimer(hwndDlg, 1); UnhookEvent(dat->hPreshutdown); Window_FreeIcon_IcoLib(hwndDlg); - SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)OldMessageEditProc); mir_free(dat); hwndStatusMsg = NULL; break; -- cgit v1.2.3