diff options
Diffstat (limited to 'tipper/popwin.cpp')
-rw-r--r-- | tipper/popwin.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
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++) {
|