summaryrefslogtreecommitdiff
path: root/src/modules/options
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 /src/modules/options
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 'src/modules/options')
-rw-r--r--src/modules/options/options.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index 952e30361a..e7fd848af1 100644
--- a/src/modules/options/options.cpp
+++ b/src/modules/options/options.cpp
@@ -252,15 +252,13 @@ static int MatchesFilter(const OptionsPageData *page, TCHAR *szFilterString)
return ContainsFilterString(key, szFilterString);
}
-static WNDPROC OptionsFilterDefaultProc = NULL;
-
static LRESULT CALLBACK OptionsFilterSubclassProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (message != WM_PAINT && message != WM_PRINT)
- return CallWindowProc(OptionsFilterDefaultProc, hWnd, message, wParam, lParam);
+ return mir_callNextSubclass(hWnd, OptionsFilterSubclassProc, message, wParam, lParam);
if (GetFocus() == hWnd || GetWindowTextLength(hWnd))
- return CallWindowProc(OptionsFilterDefaultProc, hWnd, message, wParam, lParam);
+ return mir_callNextSubclass(hWnd, OptionsFilterSubclassProc, message, wParam, lParam);
RECT rc;
GetClientRect(hWnd, &rc);
@@ -386,7 +384,7 @@ static void AeroPaintControl(HWND hwnd, HDC hdc, WNDPROC OldWndProc, UINT msg =
//paint
SetPropA(hwnd, "Miranda.AeroRender.Active", (HANDLE)TRUE);
- CallWindowProc(OldWndProc, hwnd, msg, (WPARAM)tempDC, lpFlags);
+ mir_callNextSubclass(hwnd, OldWndProc, msg, (WPARAM)tempDC, lpFlags);
SetPropA(hwnd, "Miranda.AeroRender.Active", (HANDLE)FALSE);
// Fix alpha channel
@@ -403,7 +401,6 @@ static void AeroPaintControl(HWND hwnd, HDC hdc, WNDPROC OldWndProc, UINT msg =
static LRESULT CALLBACK AeroPaintSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- WNDPROC OldWndProc = (WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch (msg) {
case WM_CTLCOLOREDIT:
if ( !GetPropA((HWND)lParam, "Miranda.AeroRender.Active"))
@@ -415,14 +412,14 @@ static LRESULT CALLBACK AeroPaintSubclassProc(HWND hwnd, UINT msg, WPARAM wParam
case WM_PRINT:
case WM_PRINTCLIENT:
- AeroPaintControl(hwnd, (HDC)wParam, OldWndProc, msg, lParam);
+ AeroPaintControl(hwnd, (HDC)wParam, AeroPaintSubclassProc, msg, lParam);
return TRUE;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
- AeroPaintControl(hwnd, hdc, OldWndProc);
+ AeroPaintControl(hwnd, hdc, AeroPaintSubclassProc);
EndPaint(hwnd, &ps);
}
return TRUE;
@@ -431,7 +428,7 @@ static LRESULT CALLBACK AeroPaintSubclassProc(HWND hwnd, UINT msg, WPARAM wParam
RemovePropA(hwnd, "Miranda.AeroRender.Active");
break;
}
- return CallWindowProc(OldWndProc, hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, AeroPaintSubclassProc, msg, wParam, lParam);
}
static void CALLBACK FilterSearchTimerFunc(HWND hwnd, UINT, UINT_PTR, DWORD)
@@ -662,13 +659,11 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
COMBOBOXINFO cbi;
cbi.cbSize = sizeof(COMBOBOXINFO);
getComboBoxInfo( GetDlgItem(hdlg, IDC_KEYWORD_FILTER), &cbi);
- OptionsFilterDefaultProc = (WNDPROC)SetWindowLongPtr(cbi.hwndItem, GWLP_WNDPROC, (LONG_PTR) OptionsFilterSubclassProc);
+ mir_subclassWindow(cbi.hwndItem, OptionsFilterSubclassProc);
if (IsAeroMode()) {
- SetWindowLongPtr(cbi.hwndCombo, GWLP_USERDATA, GetWindowLongPtr(cbi.hwndCombo, GWLP_WNDPROC));
- SetWindowLongPtr(cbi.hwndCombo, GWLP_WNDPROC, (LONG_PTR)AeroPaintSubclassProc);
- SetWindowLongPtr(cbi.hwndItem, GWLP_USERDATA, GetWindowLongPtr(cbi.hwndItem, GWLP_WNDPROC));
- SetWindowLongPtr(cbi.hwndItem, GWLP_WNDPROC, (LONG_PTR)AeroPaintSubclassProc);
+ mir_subclassWindow(cbi.hwndCombo, AeroPaintSubclassProc);
+ mir_subclassWindow(cbi.hwndItem, AeroPaintSubclassProc);
}
}