summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/dlgboxsubclass.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-04 07:23:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-04 07:23:42 +0000
commit66cb770a982a2502456d10d73838df2b7239fd89 (patch)
treefc419dde94a9be3ebe8f2266ff46feb90d2bcbec /plugins/SmileyAdd/src/dlgboxsubclass.cpp
parentbc256df33a57e585367edffe33d3e58d53f82ce8 (diff)
new subclassing functions applied to all plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@3880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SmileyAdd/src/dlgboxsubclass.cpp')
-rw-r--r--plugins/SmileyAdd/src/dlgboxsubclass.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp
index eee8db0025..9184bf10ab 100644
--- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp
+++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp
@@ -61,7 +61,6 @@ public:
mutable HBITMAP hSmlBmp;
mutable HICON hSmlIco;
int idxLastChar;
- WNDPROC wpOrigWndProc;
HANDLE hContact;
bool doSmileyReplace;
bool doSmileyButton;
@@ -87,7 +86,6 @@ public:
OldButtonPlace = false;
isSplit = false;
isSend = false;
- wpOrigWndProc = NULL;
}
MsgWndData(const MsgWndData &dsb)
@@ -333,8 +331,7 @@ static void MsgWndDetect(HWND hwndDlg, HANDLE hContact, msgData* datm)
WaitForSingleObject(g_hMutex, 2000);
MsgWndData* msgwnd = g_MsgWndList.find((MsgWndData*)&hwndDlg);
- if (msgwnd == NULL)
- {
+ if (msgwnd == NULL) {
msgwnd = new MsgWndData(dat);
g_MsgWndList.insert(msgwnd);
}
@@ -342,11 +339,11 @@ static void MsgWndDetect(HWND hwndDlg, HANDLE hContact, msgData* datm)
msgwnd = NULL;
ReleaseMutex(g_hMutex);
- if (msgwnd != NULL)
- {
- msgwnd->wpOrigWndProc = (WNDPROC)SetWindowLongPtr(hwndDlg, GWLP_WNDPROC, (LONG_PTR)MessageDlgSubclass);
+ if (msgwnd != NULL) {
+ mir_subclassWindow(hwndDlg, MessageDlgSubclass);
msgwnd->CreateSmileyButton();
- if (hContact == NULL) SetRichCallback(msgwnd->REdit, msgwnd->hContact, true, true);
+ if (hContact == NULL)
+ SetRichCallback(msgwnd->REdit, msgwnd->hContact, true, true);
}
}
}
@@ -377,19 +374,16 @@ static LRESULT CALLBACK MessageDlgSubclass(HWND hwnd, UINT uMsg, WPARAM wParam,
break;
}
- LRESULT result = CallWindowProc(dat->wpOrigWndProc, hwnd, uMsg, wParam, lParam);
-
- if (!opt.PluginSupportEnabled) return result;
+ LRESULT result = mir_callNextSubclass(hwnd, MessageDlgSubclass, uMsg, wParam, lParam);
+ if (!opt.PluginSupportEnabled)
+ return result;
- switch(uMsg)
- {
+ switch(uMsg) {
case WM_DESTROY:
WaitForSingleObject(g_hMutex, 2000);
- SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)dat->wpOrigWndProc);
{
int ind = g_MsgWndList.getIndex((MsgWndData*)&hwnd);
- if ( ind != -1 )
- {
+ if ( ind != -1 ) {
delete g_MsgWndList[ind];
g_MsgWndList.remove(ind);
}