From cda4bce6aea57e3c131e281551ad0b3f9f907932 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Tue, 5 Oct 2010 05:37:14 +0000 Subject: Removed unneeded redraw git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@543 4f64403b-2f21-0410-a795-97e2b3489a10 --- tipper/popwin.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'tipper/popwin.cpp') diff --git a/tipper/popwin.cpp b/tipper/popwin.cpp index ac6143c..6e8ac5c 100644 --- a/tipper/popwin.cpp +++ b/tipper/popwin.cpp @@ -620,24 +620,31 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa break; case PUM_SETSTATUSTEXT: + if (pwd && (HANDLE)wParam == pwd->hContact) { - if(pwd && (HANDLE)wParam == pwd->hContact) { - // in case we have the status message in a row - DBWriteContactSettingTString(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR*)lParam); - SendMessage(hwnd, PUM_REFRESH_VALUES, 0, 0); + // in case we have the status message in a row + DBVARIANT dbv; + if (!DBGetContactSettingTString(pwd->hContact, MODULE, "TempStatusMsg", &dbv)) + { + if (_tcscmp(dbv.ptszVal, (TCHAR*)lParam)) + { + DBWriteContactSettingTString(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR*)lParam); + SendMessage(hwnd, PUM_REFRESH_VALUES, 0, 0); + } + DBFreeVariant(&dbv); } - if(lParam) free((void *)lParam); } + if(lParam) free((void *)lParam); return TRUE; + case PUM_SETAVATAR: - { - if(pwd && (HANDLE)wParam == pwd->hContact) { - SendMessage(hwnd, PUM_GETHEIGHT, 0, 0); // calculate window height - SendMessage(hwnd, PUM_CALCPOS, 0, 0); - InvalidateRect(hwnd, 0, TRUE); - } + if(pwd && (HANDLE)wParam == pwd->hContact) { + SendMessage(hwnd, PUM_GETHEIGHT, 0, 0); // calculate window height + SendMessage(hwnd, PUM_CALCPOS, 0, 0); + InvalidateRect(hwnd, 0, TRUE); } return TRUE; + case PUM_REFRESH_VALUES: if(pwd && pwd->clcit.proto == 0 && pwd->text_tip == false) { for(int i = 0; i < pwd->row_count; i++) { -- cgit v1.2.3