From 877f34a69f77c03dd9d48ebc7fe86a8ec56189c5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 16 Jan 2014 12:49:51 +0000 Subject: fix for changing chat colors on the fly git-svn-id: http://svn.miranda-ng.org/main/trunk@7678 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/chat/window.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'plugins/Scriver/src/chat/window.cpp') diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 58c60c3481..4d0159739d 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -1010,21 +1010,18 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break; case WM_MOUSEMOVE: - POINT pt; + POINT pt = { LOWORD(lParam), HIWORD(lParam) }; RECT clientRect; - BOOL bInClient; - pt.x = LOWORD(lParam); - pt.y = HIWORD(lParam); GetClientRect(hwnd, &clientRect); - bInClient = PtInRect(&clientRect, pt); - //Mouse capturing/releasing + BOOL bInClient = PtInRect(&clientRect, pt); + // Mouse capturing/releasing if (bInClient && GetCapture() != hwnd) SetCapture(hwnd); else if (!bInClient) ReleaseCapture(); if (bInClient) { - //hit test item under mouse + // hit test item under mouse DWORD nItemUnderMouse = (DWORD)SendMessage(hwnd, LB_ITEMFROMPOINT, 0, lParam); if (HIWORD(nItemUnderMouse) == 1) nItemUnderMouse = (DWORD)(-1); @@ -1039,7 +1036,6 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return mir_callNextSubclass(hwnd, NicklistSubclassProc, msg, wParam, lParam); } - int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth) { if (!pszText || !hFont) @@ -1148,10 +1144,11 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_SETBKGNDCOLOR, 0, g_Settings.crLogBackground); { - //messagebox - COLORREF crFore; - CHARFORMAT2 cf; + // messagebox + COLORREF crFore; LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, NULL, &crFore, FALSE); + + CHARFORMAT2 cf; cf.cbSize = sizeof(CHARFORMAT2); cf.dwMask = CFM_COLOR | CFM_BOLD | CFM_UNDERLINE | CFM_BACKCOLOR; cf.dwEffects = 0; -- cgit v1.2.3