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 --- plugins/DbEditorPP/src/main_window.cpp | 17 ++++++----------- plugins/DbEditorPP/src/moduletree.cpp | 11 ++++------- 2 files changed, 10 insertions(+), 18 deletions(-) (limited to 'plugins/DbEditorPP/src') diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index c1608498a6..814361037d 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -9,8 +9,6 @@ int Hex; extern BOOL bServiceMode; -static WNDPROC SettingListSubClass, ModuleTreeSubClass, SplitterSubClass; - void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam); void SettingsListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam); @@ -79,7 +77,7 @@ static LRESULT CALLBACK SplitterSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LP return 0; } - return CallWindowProc(SplitterSubClass,hwnd,msg,wParam,lParam); + return mir_callNextSubclass(hwnd, SplitterSubclassProc, msg, wParam, lParam); } LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) @@ -149,7 +147,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM } break; } - return CallWindowProc(ModuleTreeSubClass,hwnd,msg,wParam,lParam); + return mir_callNextSubclass(hwnd, ModuleTreeSubclassProc, msg, wParam, lParam); } static LRESULT CALLBACK SettingListSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) @@ -186,7 +184,7 @@ static LRESULT CALLBACK SettingListSubclassProc(HWND hwnd,UINT msg,WPARAM wParam CreateDialog(hInst, MAKEINTRESOURCE(IDD_FIND), hwnd, FindWindowDlgProc); break; } - return CallWindowProc(SettingListSubClass,hwnd,msg,wParam,lParam); + return mir_callNextSubclass(hwnd, SettingListSubclassProc, msg, wParam, lParam); } INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -203,13 +201,13 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) // setup the splitter SetWindowLongPtr(GetDlgItem(hwnd,IDC_SPLITTER),GWLP_USERDATA,(LPARAM)DBGetContactSettingWord(NULL, modname, "Splitter", 300)); SendMessage(hwnd, GC_SPLITTERMOVED, 0,0); - SplitterSubClass=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwnd,IDC_SPLITTER),GWLP_WNDPROC,(LONG)SplitterSubclassProc); + mir_subclassWindow(GetDlgItem(hwnd,IDC_SPLITTER), SplitterSubclassProc); // module tree TreeView_SetUnicodeFormat(GetDlgItem(hwnd,IDC_MODULES), TRUE); - ModuleTreeSubClass=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwnd,IDC_MODULES),GWLP_WNDPROC,(LONG)ModuleTreeSubclassProc); + mir_subclassWindow(GetDlgItem(hwnd,IDC_MODULES), ModuleTreeSubclassProc); //setting list setupSettingsList(GetDlgItem(hwnd,IDC_SETTINGS)); - SettingListSubClass=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwnd,IDC_SETTINGS),GWLP_WNDPROC,(LONG)SettingListSubclassProc); + mir_subclassWindow(GetDlgItem(hwnd,IDC_SETTINGS), SettingListSubclassProc); HMENU hMenu = GetMenu(hwnd); TranslateMenu(hMenu); @@ -420,9 +418,6 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ImageList_Destroy(himl); if (himl2) ImageList_Destroy(himl2); - SetWindowLongPtr(GetDlgItem(hwnd,IDC_SETTINGS),GWLP_WNDPROC,(LONG)SettingListSubClass); - SetWindowLongPtr(GetDlgItem(hwnd,IDC_MODULES),GWLP_WNDPROC,(LONG)ModuleTreeSubClass); - SetWindowLongPtr(GetDlgItem(hwnd,IDC_SPLITTER),GWLP_WNDPROC,(LONG)SplitterSubClass); if (!DBGetContactSettingByte(NULL,modname,"Maximised",0)) { RECT rc; diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp index f7667f6f27..ea520eacc2 100644 --- a/plugins/DbEditorPP/src/moduletree.cpp +++ b/plugins/DbEditorPP/src/moduletree.cpp @@ -564,15 +564,11 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di) } - -static WNDPROC ModuleTreeLabelEditSubClass; - static LRESULT CALLBACK ModuleTreeLabelEditSubClassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) { switch(msg) { case WM_KEYUP: - switch (wParam) - { + switch (wParam) { case VK_RETURN: TreeView_EndEditLabelNow(GetParent(hwnd),0); return 0; @@ -582,8 +578,9 @@ static LRESULT CALLBACK ModuleTreeLabelEditSubClassProc(HWND hwnd,UINT msg,WPARA } break; } - return CallWindowProc(ModuleTreeLabelEditSubClass,hwnd,msg,wParam,lParam); + return mir_callNextSubclass(hwnd, ModuleTreeLabelEditSubClassProc, msg, wParam, lParam); } + void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam); void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd here is to the main window, NOT the treview @@ -751,7 +748,7 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd SetWindowLongPtr(hwnd, DWLP_MSGRESULT, TRUE); break; } - ModuleTreeLabelEditSubClass = (WNDPROC)SetWindowLongPtr(hwnd2Edit, GWLP_WNDPROC, (LONG)ModuleTreeLabelEditSubClassProc); + mir_subclassWindow(hwnd2Edit, ModuleTreeLabelEditSubClassProc); SetWindowLongPtr(hwnd, DWLP_MSGRESULT, FALSE); } break; -- cgit v1.2.3