From fa3cdddd7fa6c0b50b117709da605a524e36117a Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Tue, 6 Mar 2012 10:13:13 +0000 Subject: Compatibility with Unicode avatars git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@597 4f64403b-2f21-0410-a795-97e2b3489a10 --- tipper/popwin.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'tipper/popwin.cpp') diff --git a/tipper/popwin.cpp b/tipper/popwin.cpp index d0cbf4f..79f6f17 100644 --- a/tipper/popwin.cpp +++ b/tipper/popwin.cpp @@ -262,7 +262,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa PROTO_AVATAR_INFORMATION AI = {0}; AI.cbSize = sizeof(AI); AI.hContact = pwd->hContact; - CallService(svc, (WPARAM)GAIF_FORCE, (LPARAM)&AI); + CallService(svc, 0, (LPARAM)&AI); } SendMessage(hwnd, PUM_REFRESH_VALUES, 0, 0); } @@ -574,7 +574,6 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } if(pwd->rows) free(pwd->rows); - if(pwd->hBm) DeleteObject(pwd->hBm); free(pwd); pwd = 0; SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); } @@ -730,25 +729,24 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // avatar height pwd->av_height = 0; - if(!pwd->text_tip && options.av_layout != PAV_NONE && ServiceExists(MS_AV_DRAWAVATAR)) { + if (!pwd->text_tip && options.av_layout != PAV_NONE && ServiceExists(MS_AV_DRAWAVATAR)) + { AVATARCACHEENTRY *ace = 0; - if(pwd->hContact) ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)pwd->hContact, 0); + if (pwd->hContact) ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)pwd->hContact, 0); else ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)pwd->clcit.proto); - if(ace && (ace->dwFlags & AVS_BITMAP_VALID) && !(ace->dwFlags & AVS_HIDEONCLIST)) { - if(pwd->hBm) DeleteObject(pwd->hBm); - pwd->hBm = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)ace->szFilename); - BITMAP bm; - GetObject(pwd->hBm, sizeof(bm), &bm); - if(options.no_resize_av || (bm.bmHeight <= options.av_size && bm.bmWidth <= options.av_size)) { - pwd->real_av_width = bm.bmWidth; - pwd->real_av_height = bm.bmHeight; + if (ace && (ace->dwFlags & AVS_BITMAP_VALID) && !(ace->dwFlags & AVS_HIDEONCLIST)) + { + pwd->hBm = ace->hbmPic; + if (options.no_resize_av || (ace->bmHeight <= options.av_size && ace->bmWidth <= options.av_size)) { + pwd->real_av_width = ace->bmWidth; + pwd->real_av_height = ace->bmHeight; } else { - if(bm.bmHeight >= bm.bmWidth) { + if (ace->bmHeight >= ace->bmWidth) { pwd->real_av_height = options.av_size; - pwd->real_av_width = (int)(options.av_size * (bm.bmWidth / (double)bm.bmHeight)); + pwd->real_av_width = options.av_size * ace->bmWidth / ace->bmHeight; } else { - pwd->real_av_height = (int)(options.av_size * (bm.bmHeight / (double)bm.bmWidth)); + pwd->real_av_height = options.av_size * ace->bmHeight / ace->bmWidth; pwd->real_av_width = options.av_size; } } -- cgit v1.2.3