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 /plugins/SpellChecker/src/utils.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 'plugins/SpellChecker/src/utils.cpp')
-rw-r--r-- | plugins/SpellChecker/src/utils.cpp | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 5b46486e6f..77d31a381f 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -523,7 +523,7 @@ LRESULT CALLBACK OwnerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) dlg->changed = TRUE; } - return CallWindowProc(dlg->owner_old_edit_proc, hwnd, msg, wParam, lParam); + return mir_callNextSubclass(hwnd, OwnerProc, msg, wParam, lParam); } void ToggleEnabled(Dialog *dlg) @@ -565,7 +565,7 @@ LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return 1; } - LRESULT ret = CallWindowProc(dlg->old_edit_proc, hwnd, msg, wParam, lParam); + LRESULT ret = mir_callNextSubclass(hwnd, EditProc, msg, wParam, lParam); switch(msg) { case WM_KEYDOWN: @@ -932,12 +932,12 @@ int AddContactTextBox(HANDLE hContact, HWND hwnd, char *name, BOOL srmm, HWND hw if (opts.auto_locale) LoadDictFromKbdl(dlg); - dlg->old_edit_proc = (WNDPROC) SetWindowLongPtr(dlg->hwnd, GWLP_WNDPROC, (LONG_PTR) EditProc); + mir_subclassWindow(dlg->hwnd, EditProc); dialogs[hwnd] = dlg; if (dlg->srmm && hwndOwner != NULL) { dlg->hwnd_owner = hwndOwner; - dlg->owner_old_edit_proc = (WNDPROC) SetWindowLongPtr(dlg->hwnd_owner, GWLP_WNDPROC, (LONG_PTR) OwnerProc); + mir_subclassWindow(dlg->hwnd_owner, OwnerProc); dialogs[dlg->hwnd_owner] = dlg; ModifyIcon(dlg); @@ -959,14 +959,6 @@ void FreePopupData(Dialog *dlg) DESTROY_MENY(dlg->hLanguageSubMenu) DESTROY_MENY(dlg->hWrongWordsSubMenu) - if (dlg->old_menu_proc != NULL) - SetWindowLongPtr(dlg->hwnd_menu_owner, GWLP_WNDPROC, (LONG_PTR) dlg->old_menu_proc); - dlg->old_menu_proc = NULL; - - if (dlg->hwnd_menu_owner != NULL) - menus.erase(dlg->hwnd_menu_owner); - dlg->hwnd_menu_owner = NULL; - if (dlg->wrong_words != NULL) { for (unsigned i = 0; i < dlg->wrong_words->size(); i++) { FREE((*dlg->wrong_words)[i].word) @@ -1000,15 +992,9 @@ int RemoveContactTextBox(HWND hwnd) KillTimer(hwnd, TIMER_ID); - if (dlg->old_edit_proc != NULL) - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) dlg->old_edit_proc); dialogs.erase(hwnd); - - if (dlg->hwnd_owner != NULL) { - if (dlg->owner_old_edit_proc != NULL) - SetWindowLongPtr(dlg->hwnd_owner, GWLP_WNDPROC, (LONG_PTR) dlg->owner_old_edit_proc); + if (dlg->hwnd_owner != NULL) dialogs.erase(dlg->hwnd_owner); - } delete dlg->re; FreePopupData(dlg); @@ -1200,7 +1186,7 @@ void AddItemsToMenu(Dialog *dlg, HMENU hMenu, POINT pt, HWND hwndOwner) dlg->hLanguageSubMenu = CreatePopupMenu(); if (dlg->hwnd_menu_owner != NULL) - dlg->old_menu_proc = (WNDPROC) SetWindowLongPtr(dlg->hwnd_menu_owner, GWLP_WNDPROC, (LONG_PTR) MenuWndProc); + mir_subclassWindow(dlg->hwnd_menu_owner, MenuWndProc); // First add languages for (int i = 0; i < languages.getCount(); i++) @@ -1450,7 +1436,7 @@ int IconPressed(WPARAM wParam, LPARAM lParam) if (opts.use_flags) { menus[dlg->hwnd] = dlg; dlg->hwnd_menu_owner = dlg->hwnd; - dlg->old_menu_proc = (WNDPROC) SetWindowLongPtr(dlg->hwnd_menu_owner, GWLP_WNDPROC, (LONG_PTR) MenuWndProc); + mir_subclassWindow(dlg->hwnd_menu_owner, MenuWndProc); } // First add languages @@ -1607,7 +1593,7 @@ LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } } - return CallWindowProc(dlg->old_menu_proc, hwnd, msg, wParam, lParam); + return mir_callNextSubclass(hwnd, MenuWndProc, msg, wParam, lParam); } TCHAR *lstrtrim(TCHAR *str) |