diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-26 23:17:39 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-26 23:17:39 +0300 |
commit | 42e20e76dd64d9f11d2f56dda7888476231dee44 (patch) | |
tree | 2eb187ecb9503a4e898eec875c6198a9f428bf1d | |
parent | 81b4f713089d7d2c3b65d5c74e5c12f85b5d7e55 (diff) |
Windows'98 compatibility code is not needed for years
-rw-r--r-- | plugins/Scriver/src/chat_window.cpp | 4 | ||||
-rw-r--r-- | plugins/Scriver/src/infobar.cpp | 1 | ||||
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/msgoptions.cpp | 1 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/richutil.cpp | 201 | ||||
-rw-r--r-- | plugins/Scriver/src/richutil.h | 38 | ||||
-rw-r--r-- | plugins/Scriver/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_window.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/richutil.cpp | 212 | ||||
-rw-r--r-- | src/core/stdmsg/src/richutil.h | 35 | ||||
-rw-r--r-- | src/core/stdmsg/src/stdafx.h | 1 |
14 files changed, 1 insertions, 503 deletions
diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index 2eedb41373..0c7398eb55 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -241,10 +241,6 @@ void CChatRoomDlg::OnInitDialog() SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this);
m_pParent = (ParentWindowData *)GetWindowLongPtr(m_hwndParent, GWLP_USERDATA);
- RichUtil_SubClass(m_message.GetHwnd());
- RichUtil_SubClass(m_log.GetHwnd());
- RichUtil_SubClass(m_nickList.GetHwnd());
-
Srmm_CreateToolbarIcons(m_hwnd, BBBF_ISCHATBUTTON);
RECT rc;
diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index d07aa45952..11f4509a0f 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -272,6 +272,5 @@ static INT_PTR CALLBACK InfobarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA void CSrmmWindow::CreateInfobar()
{
m_hwndInfo = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_INFOBAR), m_hwnd, InfobarWndProc, (LPARAM)this);
- RichUtil_SubClass(m_hwndInfo);
SetWindowPos(m_hwndInfo, HWND_TOP, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOREPOSITION);
}
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index bccea21bef..e1e2e7525a 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -314,8 +314,6 @@ void CSrmmWindow::OnInitDialog() // get around a lame bug in the Windows template resource code where richedits are limited to 0x7FFF
m_log.SendMsg(EM_LIMITTEXT, sizeof(wchar_t) * 0x7FFFFFFF, 0);
- ::RichUtil_SubClass(m_log.GetHwnd());
- ::RichUtil_SubClass(m_message.GetHwnd());
::DragAcceptFiles(m_message.GetHwnd(), TRUE);
CreateInfobar();
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 66b215694a..0e88757f6e 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -614,7 +614,6 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- RichUtil_SubClass(GetDlgItem(hwndDlg, IDC_SRMM_LOG));
switch (db_get_b(0, SRMM_MODULE, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
case LOADHISTORY_UNREAD:
CheckDlgButton(hwndDlg, IDC_LOADUNREAD, BST_CHECKED);
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 6e1f443b8a..90f5c36252 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -598,7 +598,6 @@ int OnUnloadModule(void) ReleaseIcons();
FreeMsgLogIcons();
- RichUtil_Unload();
FreeGlobals();
FreeLibrary(hMsftEdit);
return 0;
@@ -616,7 +615,6 @@ int OnLoadModule(void) }
InitGlobals();
- RichUtil_Load();
InitStatusIcons();
RegisterIcons();
RegisterFontServiceFonts();
diff --git a/plugins/Scriver/src/richutil.cpp b/plugins/Scriver/src/richutil.cpp deleted file mode 100644 index c9a640a102..0000000000 --- a/plugins/Scriver/src/richutil.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/*
-Copyright 2000-2010 Miranda IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-
-/*
- To initialize this library, call:
- RichUtil_Load();
- Before the application exits, call:
- RichUtil_Unload();
-
- Then to use the library (it draws the xp border around it), you need
- to make sure you control has the WS_EX_STATICEDGE flag. Then you just
- subclass it with:
- RichUtil_SubClass(hwndEdit);
-
- If no xptheme is present, the window isn't subclassed the SubClass function
- just returns. And if WS_EX_STATICEDGE isn't present, the subclass does nothing.
- Otherwise it removes the border and draws it by itself.
-*/
-
-static SortedList sListInt;
-
-static int RichUtil_CmpVal(void *p1, void *p2)
-{
- TRichUtil *tp1 = (TRichUtil *)p1;
- TRichUtil *tp2 = (TRichUtil *)p2;
- return (int)((INT_PTR)tp1->hwnd - (INT_PTR)tp2->hwnd);
-}
-
-static mir_cs csRich;
-
-static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-static void RichUtil_ClearUglyBorder(TRichUtil *ru);
-
-void RichUtil_Load(void)
-{
- sListInt.increment = 10;
- sListInt.sortFunc = RichUtil_CmpVal;
-}
-
-void RichUtil_Unload(void)
-{
- List_Destroy(&sListInt);
-}
-
-int RichUtil_SubClass(HWND hwndEdit)
-{
- if (IsWindow(hwndEdit)) {
- int idx;
-
- TRichUtil *ru = (TRichUtil *)mir_calloc(sizeof(TRichUtil));
-
- ru->hwnd = hwndEdit;
- ru->hasUglyBorder = 0;
- {
- mir_cslock lck(csRich);
- if (!List_GetIndex(&sListInt, ru, &idx))
- List_Insert(&sListInt, ru, idx);
- }
- mir_subclassWindow(ru->hwnd, RichUtil_Proc);
- RichUtil_ClearUglyBorder(ru);
- return 1;
- }
- return 0;
-}
-
-static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- TRichUtil *ru = nullptr, tru;
- int idx;
- LRESULT ret;
-
- tru.hwnd = hwnd;
- {
- mir_cslock lck(csRich);
- if (List_GetIndex(&sListInt, &tru, &idx))
- ru = (TRichUtil *)sListInt.items[idx];
- }
-
- switch (msg) {
- case WM_THEMECHANGED:
- case WM_STYLECHANGED:
- RichUtil_ClearUglyBorder(ru);
- break;
-
- case WM_NCPAINT:
- ret = mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam);
- if (ru->hasUglyBorder && IsThemeActive())
- {
- HANDLE hTheme = OpenThemeData(ru->hwnd, L"EDIT");
-
- if (hTheme) {
- RECT rcBorder;
- RECT rcClient;
- int nState;
- HDC hdc = GetWindowDC(ru->hwnd);
-
- GetWindowRect(hwnd, &rcBorder);
- rcBorder.right -= rcBorder.left; rcBorder.bottom -= rcBorder.top;
- rcBorder.left = rcBorder.top = 0;
- CopyRect(&rcClient, &rcBorder);
- rcClient.left += ru->rect.left;
- rcClient.top += ru->rect.top;
- rcClient.right -= ru->rect.right;
- rcClient.bottom -= ru->rect.bottom;
- ExcludeClipRect(hdc, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom);
-
- if (IsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
- DrawThemeParentBackground(hwnd, hdc, &rcBorder);
-
- if (!IsWindowEnabled(hwnd))
- nState = ETS_DISABLED;
- else if (SendMessage(hwnd, EM_GETOPTIONS, 0, 0) & ECO_READONLY)
- nState = ETS_READONLY;
- else nState = ETS_NORMAL;
-
- DrawThemeBackground(hTheme, hdc, EP_EDITTEXT, nState, &rcBorder, nullptr);
- CloseThemeData(hTheme);
- ReleaseDC(hwnd, hdc);
- return 0;
- }
- }
- return ret;
-
- case WM_NCCALCSIZE:
- {
- ret = mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam);
- NCCALCSIZE_PARAMS *ncsParam = (NCCALCSIZE_PARAMS *)lParam;
-
- if (ru->hasUglyBorder && IsThemeActive()) {
- HANDLE hTheme = OpenThemeData(hwnd, L"EDIT");
- if (hTheme) {
- RECT rcClient = {0};
- HDC hdc = GetDC(GetParent(hwnd));
-
- if (GetThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &ncsParam->rgrc[0], &rcClient) == S_OK) {
- ru->rect.left = rcClient.left - ncsParam->rgrc[0].left;
- ru->rect.top = rcClient.top - ncsParam->rgrc[0].top;
- ru->rect.right = ncsParam->rgrc[0].right - rcClient.right;
- ru->rect.bottom = ncsParam->rgrc[0].bottom - rcClient.bottom;
- ncsParam->rgrc[0] = rcClient;
-
- CloseThemeData(hTheme);
- ReleaseDC(GetParent(hwnd), hdc);
- return WVR_REDRAW;
- }
- ReleaseDC(GetParent(hwnd), hdc);
- CloseThemeData(hTheme);
- }
- }
- }
- return ret;
-
- case WM_ENABLE:
- RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
- break;
-
- case WM_GETDLGCODE:
- return mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam) & ~DLGC_HASSETSEL;
-
- case WM_NCDESTROY:
- ret = mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam);
- {
- mir_cslock lck(csRich);
- List_Remove(&sListInt, idx);
- }
- mir_free(ru);
- return ret;
- }
- return mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam);
-}
-
-static void RichUtil_ClearUglyBorder(TRichUtil *ru)
-{
- if (IsThemeActive() && GetWindowLongPtr(ru->hwnd, GWL_EXSTYLE) & WS_EX_STATICEDGE) {
- ru->hasUglyBorder = 1;
- SetWindowLongPtr(ru->hwnd, GWL_EXSTYLE, GetWindowLongPtr(ru->hwnd, GWL_EXSTYLE) ^ WS_EX_STATICEDGE);
- }
-
- // Redraw window since the style may have changed
- SetWindowPos(ru->hwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
- RedrawWindow(ru->hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
-}
diff --git a/plugins/Scriver/src/richutil.h b/plugins/Scriver/src/richutil.h deleted file mode 100644 index 797df9fd19..0000000000 --- a/plugins/Scriver/src/richutil.h +++ /dev/null @@ -1,38 +0,0 @@ -/*
-SRMM
-
-Copyright (c) 2000-09 Miranda ICQ/IM project,
-
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef SRMM_RICHUTIL_H
-#define SRMM_RICHUTIL_H
-
-#define RWinVerMajor() LOBYTE(LOWORD(GetVersion()))
-
-typedef struct {
- HWND hwnd;
- RECT rect;
- int hasUglyBorder;
-} TRichUtil;
-
-void RichUtil_Load();
-void RichUtil_Unload();
-int RichUtil_SubClass(HWND hwndEdit);
-
-#endif
diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h index cd4c800ef1..77a01e40a2 100644 --- a/plugins/Scriver/src/stdafx.h +++ b/plugins/Scriver/src/stdafx.h @@ -116,7 +116,6 @@ int StatusIconPressed(WPARAM wParam, LPARAM lParam); #include "tabs.h"
#include "utils.h"
#include "input.h"
-#include "richutil.h"
#include "statusicon.h"
#include "chat.h"
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index e1315d7dee..4153a2a7b1 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -459,7 +459,7 @@ LBL_SkipEnd: // calculate the required rectangle for a string using the given font. This is more // precise than using GetTextExtentPoint...() -int GetTextPixelSize(wchar_t* pszText, HFONT hFont, bool bWidth) +int GetTextPixelSize(wchar_t *pszText, HFONT hFont, bool bWidth) { if (!pszText || !hFont) return 0; diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 5de597765b..71ec207848 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -151,8 +151,6 @@ void CSrmmWindow::OnInitDialog() }
m_szProto = GetContactProto(m_hContact);
- RichUtil_SubClass(m_log.GetHwnd());
- RichUtil_SubClass(m_message.GetHwnd());
// avatar stuff
m_limitAvatarH = db_get_b(NULL, SRMMMOD, SRMSGSET_LIMITAVHEIGHT, SRMSGDEFSET_LIMITAVHEIGHT) ? db_get_dw(NULL, SRMMMOD, SRMSGSET_AVHEIGHT, SRMSGDEFSET_AVHEIGHT) : 0;
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 79984e8a0b..0c049ff6f6 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -530,7 +530,6 @@ int LoadSendRecvMessageModule(void) }
InitGlobals();
- RichUtil_Load();
InitOptions();
HookEvent(ME_DB_EVENT_ADDED, MessageEventAdded);
@@ -572,7 +571,6 @@ void SplitmsgShutdown(void) FreeMsgLogIcons();
FreeLibrary(hMsftEdit);
- RichUtil_Unload();
msgQueue_destroy();
}
diff --git a/src/core/stdmsg/src/richutil.cpp b/src/core/stdmsg/src/richutil.cpp deleted file mode 100644 index b461d91e26..0000000000 --- a/src/core/stdmsg/src/richutil.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/*
-
-Copyright 2000-12 Miranda IM, 2012-17 Miranda NG project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-#include "richutil.h"
-
-/*
- To initialize this library, call:
- RichUtil_Load();
- Before the application exits, call:
- RichUtil_Unload();
-
- Then to use the library (it draws the xp border around it), you need
- to make sure you control has the WS_EX_CLIENTEDGE flag. Then you just
- subclass it with:
- RichUtil_SubClass(hwndEdit);
-
- If no xptheme is present, the window isn't subclassed the SubClass function
- just returns. And if WS_EX_CLIENTEDGE isn't present, the subclass does nothing.
- Otherwise it removes the border and draws it by itself.
-*/
-
-static SortedList sListInt;
-
-static int RichUtil_CmpVal(void *p1, void *p2)
-{
- TRichUtil *tp1 = (TRichUtil*)p1;
- TRichUtil *tp2 = (TRichUtil*)p2;
- return (int)((INT_PTR)tp1->hwnd - (INT_PTR)tp2->hwnd);
-}
-
-static mir_cs csRich;
-
-static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-static void RichUtil_ClearUglyBorder(TRichUtil *ru);
-
-void RichUtil_Load(void)
-{
- sListInt.increment = 10;
- sListInt.sortFunc = RichUtil_CmpVal;
-}
-
-void RichUtil_Unload(void)
-{
- List_Destroy(&sListInt);
-}
-
-int RichUtil_SubClass(HWND hwndEdit)
-{
- if (IsWindow(hwndEdit)) {
- int idx;
-
- TRichUtil *ru = (TRichUtil*)mir_calloc(sizeof(TRichUtil));
-
- ru->hwnd = hwndEdit;
- ru->hasUglyBorder = 0;
- {
- mir_cslock lck(csRich);
- if (!List_GetIndex(&sListInt, ru, &idx))
- List_Insert(&sListInt, ru, idx);
- }
- mir_subclassWindow(ru->hwnd, RichUtil_Proc);
- RichUtil_ClearUglyBorder(ru);
- return 1;
- }
- return 0;
-}
-
-static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- TRichUtil *ru;
- {
- mir_cslock lck(csRich);
- ru = (TRichUtil *)List_Find(&sListInt, (TRichUtil*)&hwnd);
- }
-
- if (ru == NULL) return 0;
-
- switch (msg) {
- case WM_CHAR:
- {
- HWND hwndMsg = GetDlgItem(GetParent(hwnd), IDC_SRMM_MESSAGE);
- if (hwndMsg != hwnd) {
- SetFocus(hwndMsg);
- if (wParam != '\t') SendMessage(hwndMsg, WM_CHAR, wParam, lParam);
- }
- }
- break;
-
- case WM_THEMECHANGED:
- case WM_STYLECHANGED:
- RichUtil_ClearUglyBorder(ru);
- break;
-
- case WM_NCPAINT:
- {
- LRESULT ret = mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam);
- if (ru->hasUglyBorder && IsThemeActive()) {
- HANDLE hTheme = OpenThemeData(ru->hwnd, L"EDIT");
- if (hTheme) {
- RECT rcBorder;
- RECT rcClient;
- int nState;
- HDC hdc = GetWindowDC(ru->hwnd);
- LONG style = GetWindowLongPtr(hwnd, GWL_STYLE);
-
- GetWindowRect(hwnd, &rcBorder);
- rcBorder.right -= rcBorder.left; rcBorder.bottom -= rcBorder.top;
- rcBorder.left = rcBorder.top = 0;
- CopyRect(&rcClient, &rcBorder);
- rcClient.left += ru->rect.left;
- rcClient.top += ru->rect.top;
- rcClient.right -= ru->rect.right;
- rcClient.bottom -= ru->rect.bottom;
- ExcludeClipRect(hdc, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom);
-
- if (IsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
- DrawThemeParentBackground(hwnd, hdc, &rcBorder);
-
- if (style & WS_DISABLED)
- nState = ETS_DISABLED;
- else if (style & ES_READONLY)
- nState = ETS_READONLY;
- else
- nState = ETS_NORMAL;
-
- DrawThemeBackground(hTheme, hdc, EP_EDITTEXT, nState, &rcBorder, NULL);
- CloseThemeData(hTheme);
- ReleaseDC(hwnd, hdc);
- return 0;
- }
- }
- return ret;
- }
-
- case WM_NCCALCSIZE:
- {
- LRESULT ret = mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam);
- NCCALCSIZE_PARAMS *ncsParam = (NCCALCSIZE_PARAMS*)lParam;
-
- if (ru->hasUglyBorder && IsThemeActive()) {
- HANDLE hTheme = OpenThemeData(hwnd, L"EDIT");
- if (hTheme) {
- RECT rcClient = {};
- HDC hdc = GetDC(GetParent(hwnd));
-
- if (GetThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &ncsParam->rgrc[0], &rcClient) == S_OK) {
- ru->rect.left = rcClient.left - ncsParam->rgrc[0].left;
- ru->rect.top = rcClient.top - ncsParam->rgrc[0].top;
- ru->rect.right = ncsParam->rgrc[0].right - rcClient.right;
- ru->rect.bottom = ncsParam->rgrc[0].bottom - rcClient.bottom;
- ncsParam->rgrc[0] = rcClient;
-
- CloseThemeData(hTheme);
- ReleaseDC(GetParent(hwnd), hdc);
- return WVR_REDRAW;
- }
- ReleaseDC(GetParent(hwnd), hdc);
- CloseThemeData(hTheme);
- }
- }
- return ret;
- }
-
- case WM_ENABLE:
- RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
- break;
-
- case WM_GETDLGCODE:
- return mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam) & ~DLGC_HASSETSEL;
-
- case WM_NCDESTROY:
- LRESULT ret = mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam);
- {
- mir_cslock lck(csRich);
- List_RemovePtr(&sListInt, ru);
- }
- mir_free(ru);
- return ret;
- }
- return mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam);
-}
-
-static void RichUtil_ClearUglyBorder(TRichUtil *ru)
-{
- if (IsThemeActive() && GetWindowLongPtr(ru->hwnd, GWL_EXSTYLE) & WS_EX_CLIENTEDGE) {
- ru->hasUglyBorder = 1;
- SetWindowLongPtr(ru->hwnd, GWL_EXSTYLE, GetWindowLongPtr(ru->hwnd, GWL_EXSTYLE) ^ WS_EX_CLIENTEDGE);
- }
-
- // Redraw window since the style may have changed
- SetWindowPos(ru->hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
- RedrawWindow(ru->hwnd, NULL, NULL, RDW_INVALIDATE | RDW_NOCHILDREN | RDW_UPDATENOW | RDW_FRAME);
-}
diff --git a/src/core/stdmsg/src/richutil.h b/src/core/stdmsg/src/richutil.h deleted file mode 100644 index 1d4d1486a8..0000000000 --- a/src/core/stdmsg/src/richutil.h +++ /dev/null @@ -1,35 +0,0 @@ -/*
-
-Copyright 2000-12 Miranda IM, 2012-17 Miranda NG project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef SRMM_RICHUTIL_H
-#define SRMM_RICHUTIL_H
-
-typedef struct {
- HWND hwnd;
- RECT rect;
- int hasUglyBorder;
-} TRichUtil;
-
-void RichUtil_Load();
-void RichUtil_Unload();
-int RichUtil_SubClass(HWND hwndEdit);
-
-#endif
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index f4b1f2768c..b0e71e7644 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -71,7 +71,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "cmdlist.h"
#include "msgs.h"
#include "globals.h"
-#include "richutil.h"
#include "version.h"
#define EM_ACTIVATE (WM_USER+0x102)
|