diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-04 07:23:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-04 07:23:42 +0000 |
commit | 66cb770a982a2502456d10d73838df2b7239fd89 (patch) | |
tree | fc419dde94a9be3ebe8f2266ff46feb90d2bcbec /src/modules/protocols/protoopts.cpp | |
parent | bc256df33a57e585367edffe33d3e58d53f82ce8 (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 'src/modules/protocols/protoopts.cpp')
-rw-r--r-- | src/modules/protocols/protoopts.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index 7b128dcea7..4eec5c28b1 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -227,12 +227,9 @@ struct TAccMgrData struct TAccListData
{
- WNDPROC oldWndProc;
- int iItem;
+ int iItem;
RECT rcCheck;
-
HWND hwndEdit;
- WNDPROC oldEditProc;
};
static void sttClickButton(HWND hwndDlg, int idcButton)
@@ -272,7 +269,7 @@ static LRESULT CALLBACK sttEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, DestroyWindow(hwnd);
return 0;
}
- return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, sttEditSubclassProc, msg, wParam, lParam);
}
static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -338,7 +335,7 @@ static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA ++rc.top; --rc.right;
dat->hwndEdit = CreateWindow(_T("EDIT"), pa->tszAccountName, WS_CHILD|WS_BORDER|ES_AUTOHSCROLL, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, hwnd, NULL, hInst, NULL);
- SetWindowLongPtr(dat->hwndEdit, GWLP_USERDATA, SetWindowLongPtr(dat->hwndEdit, GWLP_WNDPROC, (LONG_PTR)sttEditSubclassProc));
+ mir_subclassWindow(dat->hwndEdit, sttEditSubclassProc);
SendMessage(dat->hwndEdit, WM_SETFONT, (WPARAM)parentDat->hfntTitle, 0);
SendMessage(dat->hwndEdit, EM_SETMARGINS, EC_LEFTMARGIN|EC_RIGHTMARGIN|EC_USEFONTINFO, 0);
SendMessage(dat->hwndEdit, EM_SETSEL, 0, (LPARAM) (-1));
@@ -371,7 +368,7 @@ static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA break;
}
- return CallWindowProc(dat->oldWndProc, hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, AccListWndProc, msg, wParam, lParam);
}
static void sttSubclassAccList(HWND hwnd, BOOL subclass)
@@ -379,13 +376,11 @@ static void sttSubclassAccList(HWND hwnd, BOOL subclass) if (subclass) {
struct TAccListData *dat = (struct TAccListData *)mir_alloc(sizeof(struct TAccListData));
dat->iItem = -1;
- dat->oldWndProc = (WNDPROC)GetWindowLongPtr(hwnd, GWLP_WNDPROC);
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)dat);
- SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)AccListWndProc);
+ mir_subclassWindow(hwnd, AccListWndProc);
}
else {
struct TAccListData *dat = (struct TAccListData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)dat->oldWndProc);
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
mir_free(dat);
}
|