summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-15 11:10:19 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-15 11:10:19 +0000
commit8e10b13b38995be8e810342d21040a4324cbfeef (patch)
treefe373e4254f152baceceb96837589a0f1fc90100 /plugins/Clist_modern
parentec72adc886bfaac0cb1ed19520a555bbe0f9f1cd (diff)
nasty clutch with the custom window proc replaced with the standard mir_subclassWindow
git-svn-id: http://svn.miranda-ng.org/main/trunk@5359 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index a2624b8f17..d3156fd08c 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -216,8 +216,7 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
switch( msg ) {
case WM_ERASEBKGND:
- pMTBInfo->lResult = (g_CluiData.fDisableSkinEngine) ? sttDrawToolBarBackground(hwnd, (HDC)wParam, NULL, pMTBInfo) : 0;
- return 1;
+ return (g_CluiData.fDisableSkinEngine) ? sttDrawToolBarBackground(hwnd, (HDC)wParam, NULL, pMTBInfo) : 0;
case WM_NCPAINT:
case WM_PAINT:
@@ -233,15 +232,12 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
EndPaint(hwnd,&ps);
}
}
-
- pMTBInfo->lResult = DefWindowProc(hwnd, msg, wParam, lParam);
- return 1;
+ return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_NOTIFY:
if (((LPNMHDR) lParam)->code == BUTTONNEEDREDRAW)
pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
- pMTBInfo->lResult = 0;
- return 1;
+ return 0;
case MTBM_LAYEREDPAINT:
{
@@ -263,19 +259,15 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
SendMessage(mtbi->hWindow, BUTTONDRAWINPARENT, (WPARAM)hDC, (LPARAM)&Offset);
}
}
- pMTBInfo->lResult = 0;
- return 1;
+ return 0;
case WM_DESTROY:
xpt_FreeThemeForWindow(hwnd);
CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)hwnd, 0);
-
- default:
- return 0;
+ break;
}
- pMTBInfo->lResult = TRUE;
- return 1;
+ return mir_callNextSubclass(hwnd, toolbarWndProc, msg, wParam, lParam);
}
static int ToolBar_LayeredPaintProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData)
@@ -285,8 +277,8 @@ static int ToolBar_LayeredPaintProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn,
void CustomizeToolbar(HWND hwnd)
{
- TTBCtrlCustomize custData = { sizeof(ModernToolbarCtrl), toolbarWndProc };
- SendMessage(hwnd, TTB_SETCUSTOM, 0, (LPARAM)&custData);
+ mir_subclassWindow(hwnd, toolbarWndProc);
+ SendMessage(hwnd, TTB_SETCUSTOMDATASIZE, 0, sizeof(ModernToolbarCtrl));
ModernToolbarCtrl* pMTBInfo = (ModernToolbarCtrl*)GetWindowLongPtr(hwnd, 0);